How do I troubleshoot RasterMaster or PrizmDoc for Java OutOfMemoryErrors?

Modified on Fri, Sep 6, 2024 at 4:59 PM

I have a document that will not load or convert with PrizmDoc for Java or RasterMaster. The stack trace or logs mention

java.lang.OutOfMemoryError: Java heap space

In this scenario, the JVM likely does not have enough heap space to handle processing a particular document. It is recommended check to see what the current max heap size is set to.


The following snippet will print out OS and JVM variables including your current max heap.


public class ReadEnvironment
    {
    public static void main(String args[]) {
      try {
                System.out.println("Path:          " + System.getProperty("java.class.path"));
                System.out.println("Class Version: " + System.getProperty("java.class.version"));
                System.out.println("Compiler:      " + System.getProperty("java.compiler"));
                System.out.println("Ext dirs:      " + System.getProperty("java.ext.dirs"));
                System.out.println("Java home:     " + System.getProperty("java.home"));
                System.out.println("Tmp dir:       " + System.getProperty("java.io.tmpdir"));
                System.out.println("Lib path:      " + System.getProperty("java.library.path"));
                System.out.println("Spec name:     " + System.getProperty("java.specification.name"));
                System.out.println("Spec vendor:   " + System.getProperty("java.specification.vendor"));
                System.out.println("Spec version:  " + System.getProperty("java.specification.version"));
                System.out.println("Java vendor:   " + System.getProperty("java.vendor"));
                System.out.println("Vendor url:    " + System.getProperty("java.vendor.url"));
                System.out.println("Java version:  " + System.getProperty("java.version"));
                System.out.println("Java vm name:  " + System.getProperty("java.vm.name"));
                System.out.println("Vm spec name:  " + System.getProperty("java.vm.specification.name"));
                System.out.println("Vm spec vendor:  " + System.getProperty("java.vm.specification.vendor"));
                System.out.println("Vm spec version: " + System.getProperty("java.vm.specification.version"));
                System.out.println("Java vm vendor:  " + System.getProperty("java.vm.vendor"));
                System.out.println("Java vm version: " + System.getProperty("java.vm.version"));
                System.out.println("OS architect:    " + System.getProperty("os.arch"));
                System.out.println("OS name:         " + System.getProperty("os.name"));
                System.out.println("OS version:      " + System.getProperty("os.version"));
                System.out.println("Path separator   " + System.getProperty("path.separator"));
                System.out.println("File separator:  " + System.getProperty("file.separator"));

                System.out.println("Heap size max (MB):  " + (Runtime.getRuntime().maxMemory()/1048576.0));
                System.out.println("Heap size current (MB):  " + (Runtime.getRuntime().totalMemory()/1048576.0));
                // Get amount of free memory within the heap in bytes. This size will increase
                // after garbage collection and decrease as new objects are created.
                System.out.println("Heap size free (MB):  " + (Runtime.getRuntime().freeMemory()/1048576.0));

                System.out.println("User dir:        " + System.getProperty("user.dir"));
                System.out.println("User home:       " + System.getProperty("user.home"));
                System.out.println("User name:       " + System.getProperty("user.name"));
      }
      catch (Throwable e) {
        e.printStackTrace();
      }
    }

    }

If max heap (-Xmx) is 256m or lower, double this value until you no longer see OutOfMemoryErrors.


If max heap is already set to a higher value, 4gb, 8gb, etc, review the file for abnormalities, please reach out to Accusoft support for more help.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article