HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › Possible memory leak in finalizers › Re: Re: Possible memory leak in finalizers
PD4ML caches objects using soft references in a static hash table. As soon as there is a shortage of RAM, JVM must automatically release such objects and deallocate consumed RAM. If there is no allocation requests, it is up to JVM either to keep the objects cached or garbage-collect them.
There is an API call pd4ml.clearCache() forces to clean cache (and consumed RAM). The JVM setting -Dpd4ml.cache.enable=false disables caching at all.
After a particular image is loaded by PD4ML it is also instantiated as Imager object. If AWT also caches images of not – depends on a particular JVM implementation.
As for me it is suspicious, that the data is accumulated somewhere in the internals sun.awt.image.ToolkitImage.