Q: I sometimes get a “java heap space” error when running PDF Automation Server. What does this mean?

A: When running intense processes in PDF Automation Server, you may get a “java heap space” exception. This happens when PDF Automation Server is running out of memory.

By default, PDF Automation Server is allocated 512Mb of memory. If your computer has more than 2GB of RAM, you can allocate more memory by following the steps below. Make sure you have enough memory available or your machine will start swapping memory and be unresponsive.

How to increase memory in PDF Automation Server

On Windows:

  1. Close / Exit PDF Automation Server
  2. Open the file called QoppaPAS.vmoptions located in PDF Automation Server installation directory: C:\Program Files\QoppaPAS (Some Windows versions will require you to start Notepad as an administrator and open the file from there to be able to save it)
  3. Change -Xmx512m with -Xmx1024m to increase the allocation to 1024MB, for instance
    1. NOTE: The memory is typically limited to 1024MB. If you installed using the 64-bit installer you are only limited by the amount of memory available on your system.
  4. Save the file
  5. Launch PDF Automation Server

On Mac:

  1. Close / Exit PDF Automation Server
  2. Open Finder
  3. Go to Applications
  4. Right Click or CTRL + Click on the PDF Automation Server Application icon and select “Show Package Contents” in the menu
  5. Click on Contents
  6. Double-Click on Info.plist to open the file
    1. Note (Lion Only) In Lion, the file is locked by default. Click on “Locked” and change it to “Unlocked”. Open the Java “node” by clicking on the little arrow
  7. Change -Xmx512m with -Xmx1024m to increase the allocation to 1024MB, for instance
    1. NOTE: The memory is typically limited to 1024MB. If you installed using the installer for Mac OS X 10.8 and above you are only limited by the amount of memory available on your system.
  8. Save the file (On Lion, use File -> Save a Version to save the file)
  9. Launch PDF Automation Server

On Linux / Unix:

  1. Close / Exit PDF Automation Server
  2. Open the file called QoppaPAS.vmoptions located in PDF Automation Server installation directory. If this file does not exist, create an empty file with this name.
  3. Change -Xmx512m with -Xmx1024m to increase the allocation to 1024MB, for instance
    1. NOTE: The memory is typically limited to 1024MB. If you installed using the 64-bit installer you are only limited by the amount of memory available on your system.
  4. Save the file
  5. Launch PDF Automation Server

 

Possible issues when increasing memory:

Error: The JVM could not be started. The maximum heap size (-Xmx) might be too large

You may encounter this error when using one of PDF Automation Server 32 bit installers. The maximum heap size will usually range from 1.4G to 1.6G but it can go up to 4G. Read more about heap size limit with 32-bit JVM.

With PDF Automation Server 64 bits installers, the maximum heap size is basically nonexistent – other than the memory available on the machine of course –  as it is about the square of the memory that can be allocated in 32 bit.