Absorb table got OutOfMemoryError

hello,

I try to use TableAbsorber to handle some table in a file, but it throw OutOfMemoryError.
U verse channel directory.pdf (432.5 KB)

Below is my testing code:

public static void main(String[] args){
String file = “U verse channel directory.pdf”;

  Document doc = new Document(file);
  TableAbsorber tableAbsorber = new com.aspose.pdf.TableAbsorber();
  for(Page page :doc.getPages()){
  	System.out.println("Start to visit page:"+ page.getNumber());
  	tableAbsorber.visit(page);
  	System.out.println("End to visit page:"+ page.getNumber());
  }
  doc.close();

}

Run it and wait few minutes, got console output:
Start to visit page:1
Exception in thread “main” java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.aspose.pdf.internal.l21l.l31t.(Unknown Source)
at com.aspose.pdf.internal.l21l.l31t.lI(Unknown Source)
at com.aspose.pdf.internal.l6u.ld.ld(Unknown Source)
at com.aspose.pdf.internal.l6u.lI.lb(Unknown Source)
at com.aspose.pdf.internal.l6u.lI.(Unknown Source)
at com.aspose.pdf.internal.l6u.ld.lI(Unknown Source)
at com.aspose.pdf.internal.l6u.l0if.lI(Unknown Source)
at com.aspose.pdf.internal.l6u.l0if.lb(Unknown Source)
at com.aspose.pdf.internal.l6u.l0if.le(Unknown Source)
at com.aspose.pdf.internal.l6u.l0if.lI(Unknown Source)

I am using the newest aspose-pdf 24.2 lib and JDK1.8.
Can you check it?

Thanks!

@marksmancl
We are looking into it and will be sharing our feedback with you shortly.

@marksmancl

Have you tried using the latest version of the API as we tested using 24.3 version of the API and did not get the exception. Please try to increase the Java Heap Size as well in order to prevent such exceptions.

Yes, I increase the heap size(almost 8G) and it run successful. But the situation is my code runs as a service, and when processing this document, it uses a relatively high CPU and memory, which can cause it to not respond to other requests or respond very slowly.

May I ask if you can do some optimization for this kinds of document? I am wondering why it need such big resouce there, this file seems not very big. And whatever, thanks for the reply.

@marksmancl

Would you kindly share a screenshot of the memory and resource consumption at your end with the complete environment details i.e. JDK version, OS, Installed RAM, etc.? We will log an investigation ticket and share the ID with you.

Thanks, my develop computer is Win7 64 with sp1, JDK version is JDK1.8.0_31,10GB RAM installed.
When I run the testing code, it will use almost all 8G heap and CPU often jump near to 100%.
图片.png (14.2 KB)

The performance on the server(linux) is similar. Large memory usage is a problem.

@marksmancl

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-43789

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like