Free Support Forum - groupdocs.com

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Hi Team,

I purchased this tool last week and try to redact pdf files. But after 2-3 file it gives me this error. Any file size limitation is there?

Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
at com.groupdocs.redaction.internal.c.a.ms.d.i.y.pe(Unknown Source)
at com.groupdocs.redaction.internal.c.a.ms.d.i.y.is(Unknown Source)
at com.groupdocs.redaction.integration.m.a(Unknown Source)
at com.groupdocs.redaction.integration.m.a(Unknown Source)
at com.groupdocs.redaction.integration.m.replaceText(Unknown Source)
at com.groupdocs.redaction.redactions.ExactPhraseRedaction.applyTo(Unknown Source)
at com.groupdocs.redaction.b.a(Unknown Source)
at com.groupdocs.redaction.Redactor.apply(Unknown Source)
at com.gigaforce.redaction.ApplyMultipleRedactions3.run(ApplyMultipleRedactions3.java:81)
at com.gigaforce.redaction.MainClass.main(MainClass.java:13)

@giga.neeraj

You have to increase Java heap space using the -Xmx flag as follows:

java -Xmx2048m 

You may assign 3 or 4 gigs of memory and let us know if issue persists.

There is no file limitation or any such thing. However, if you are evaluating the API without a license, you may face evaluation limitations.

I have already increased to 4GB for that but no luck. The same error persists.
Can you please tell me the Root Cause of this problem.

The product is not mature yet to be tested,

@giga.neeraj

Normally, we don’t face this error. However, in order to investigate it, we need following details from you:

  • API version that you are using (e.g. 20.6, 20.9)
  • Sample application
  • Problematic files