HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › Memory leak › Re: Re: Memory leak
HTML rendering (the first phase of HTML-to-PDF conversion) is a resource consuming task – you know that from your everyday browsing experience: a bulky web page rendering can “eat” all available RAM and block even a native web browser and slow down the system. HTML renderer instantiates a set of objects even for any standalone whitespace. Almost all allocated RAM is released after PD4ML object is garbage collected.
There is only exception (I guess, you see it as a “memory leak”) is a resource caching. The cache (static Map object) holds soft references to loaded resource byte arrays (images, stylesheets etc), which are to be auto-deleted when JVM is short of RAM. You may force the resource releasing by pd4ml.clearCache() API call.