Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Batik Library - Batch SVG Map Exporting - Memory Leak

Jaiden Rios5 days ago

Hello all!

In our program we are using the Batik Library (1.17) and the Transcoders that come along with it. I've been trying to tackle this issue where doing a batch export of maps causes a memory leak in our Java Application and eventually crashes the program (after exporting 25+ maps). We use PDFTranscoder to be specific and use external resources to load in icons, color codes/schemes, and more, to assemble a PDF of a map. However, I ran the visualvm tool to analyze the heap in our program and I found that there were plenty of elements that belonged to the class org.apache.batik.dom.GenericText and org.apache.batik.dom.GenericAttr that were taking up space in our heap and never got closed (or some of them do but not all of them). I tried to find a way to physically close/remove those elements but I was unsuccessful. I've tried to set all other objects to null after using them to clear up space and that was no luck. I understand Java's garbage collector is pretty smart but we still make two physical calls to System.gc() in the method that deals with PDF creation which still doesn't remove those elements from batik. I'm still fairly new to programming so any guidance on where to check first or what to change would be extremely helpful.

Comments

Post Details

Added 5 days ago
0 comments
16 views