Creating Tables for PowerPoint Presentation in Java Takes Too Much Memory

Hello,

I created a project, which creates about 40 slides, each has a table of 35 x 150.
Runtime doesn’t fit into 3 Gb of heap memory. Given 4 Gb it produces pptx file less than 200 kb (with 16 mb of internal xml representation).

code.zip (2.1 KB)

This example project resembles our real scenario, it’s not important that tables of 35 x 150 cells don’t fit the slide, they convey data.

I build project and install it with ‘gradle installDist’.
Then test it with:
JAVA_OPTS=“-XX:MaxRAM=3G -XX:MaxHeapSize=3G” ./code // fails with java.lang.OutOfMemoryError
JAVA_OPTS=“-XX:MaxRAM=4G -XX:MaxHeapSize=4G” ./code // finishes with success

parsing of just produced file with:
JAVA_OPTS=“-XX:MaxRAM=3G -XX:MaxHeapSize=3G” ./code load
finishes with success - it doesn’t require too much memory.

Can memory consumption be optimized? I think it’s too heavy for such a simple scenario.

@ygr,
Thank you for contacting support.

I’ve added a ticket with ID SLIDESJAVA-38987 to our issue-tracking system. Our development team will investigate the case. We will inform you of any progress.

Please also indicate the OS version on which the tests were performed.

It’s Debian Linux 11 (bullseye) both for production, where original problem occured and development environment, where test project reproduced similar behavior. JDK is OpenJDK 17.

@ygr,
Thank you for the additional information. I’ve forwarded it to our developers.