We have encountered an issue when using Aspose Words for Java to save large text files as PDFs. With 32MB of plain text we encounter an unexpected amount of GC which ultimately leads to an OOM error. We can consistently see OOM errors with a max heap size of 2GB. We are able to increase our max heap size to 4GB which prevents the OOM but still requires a lot of heap allocations. When the size of the file increases to the 100MB we again run into OOM issues. I’ve attached an example of the code to reproduce the issue. I’m unable to upload a sample file due to the size limitations. But any plain text file at about 100MB will reproduce the issue.
We’re using Aspose Words for Java 19.6.
Java Version:
java version “1.8.0_181”
Java™ SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)
JAVA_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xmx4g -Xms4g -XX:+UseG1GC"
aspose-words-large-text.zip (450 Bytes)
Screenshot 2019-08-10 at 10.13.04.png (292.5 KB)