You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Dominik Stadler <do...@dynatrace.com> on 2010/08/24 05:21:07 UTC

Potential memory leak, WeakReferences never collected?

Hi,



I did a long-running test with an application which uses FOP to produce PDFs, after thousands of produced PDFs I did a memory analysis and found the following:



After this the PropertyCaches consume overall aprox. 13MB of memory that is never freed again, see also the screenshot from Eclipse MAT attached, it seems many of the entries are WeakReferences that were already collected, i.e. the "reference" is null, only the WeakReference itself is still there via the CachedEntry. Somehow they are not removed from the cache properly. It seems the entries should be dereferenced by WeakReference itself via the ReferenceQueue and the "cleanSegment" method, is there a known problem with this?



Can I turn it off this cache somehow to test without it and see how much speed I would loose when avoiding this leak?



Environment is Windows 7, 64-bit, Java 1.6.0_20, fop-0.95



Thanks... Dominik.





Dominik Stadler, Team Lead
F +43 732 210100008 | E dominik.stadler@dynatrace.com<ma...@dynatrace.com> | Skype: stadler.dominik

dynaTrace is Continuous APM >> Monitor. Resolve. Prevent. >>

Web: http://www.dynatrace.com<http://www.dynatrace.com/> | Blog: http://blog.dynatrace.com<http://blog.dynatrace.com/>

Learn about dynaTrace in 2 minutes<http://www.dynatrace.com/twominutedemo/Default.aspx> | Forrester rates dynaTrace "On Fire"<http://applicationperformance.dynatrace.com/Forrester_Business_Transaction_Management_Report.html>. Get your copy of the report here<http://applicationperformance.dynatrace.com/Forrester_Business_Transaction_Management_Report.html>.

This e-mail message, including any attachments, is confidential and may contain legally privileged information. This message is intended solely for the use of the addressee. Use by others is prohibited. Disclosure, copying and distribution of this information to third parties is not permitted. If you have received this message in error, please notify us immediately and delete it from your system. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorized amendment, for which we accept no liability.




RE: Potential memory leak, WeakReferences never collected?

Posted by "Amick, Eric" <Er...@mail.house.gov>.
You might also want to try using 1.0; there was a memory leak involving WeakReferences that could very well be what you're talking about.

Eric Amick   Systems Engineer II
Legislative Computer Systems

From: Dominik Stadler [mailto:dominik.stadler@dynatrace.com]
Sent: Monday, August 23, 2010 23:21
To: fop-users@xmlgraphics.apache.org
Subject: Potential memory leak, WeakReferences never collected?

Hi,

I did a long-running test with an application which uses FOP to produce PDFs, after thousands of produced PDFs I did a memory analysis and found the following:

After this the PropertyCaches consume overall aprox. 13MB of memory that is never freed again, see also the screenshot from Eclipse MAT attached, it seems many of the entries are WeakReferences that were already collected, i.e. the "reference" is null, only the WeakReference itself is still there via the CachedEntry. Somehow they are not removed from the cache properly. It seems the entries should be dereferenced by WeakReference itself via the ReferenceQueue and the "cleanSegment" method, is there a known problem with this?

Can I turn it off this cache somehow to test without it and see how much speed I would loose when avoiding this leak?

Environment is Windows 7, 64-bit, Java 1.6.0_20, fop-0.95

Thanks... Dominik.



Dominik Stadler, Team Lead
F +43 732 210100008 | E dominik.stadler@dynatrace.com<ma...@dynatrace.com> | Skype: stadler.dominik
dynaTrace is Continuous APM >> Monitor. Resolve. Prevent. >>
Web: http://www.dynatrace.com<http://www.dynatrace.com/> | Blog: http://blog.dynatrace.com<http://blog.dynatrace.com/>
Learn about dynaTrace in 2 minutes<http://www.dynatrace.com/twominutedemo/Default.aspx> | Forrester rates dynaTrace "On Fire"<http://applicationperformance.dynatrace.com/Forrester_Business_Transaction_Management_Report.html>. Get your copy of the report here<http://applicationperformance.dynatrace.com/Forrester_Business_Transaction_Management_Report.html>.
This e-mail message, including any attachments, is confidential and may contain legally privileged information. This message is intended solely for the use of the addressee. Use by others is prohibited. Disclosure, copying and distribution of this information to third parties is not permitted. If you have received this message in error, please notify us immediately and delete it from your system. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorized amendment, for which we accept no liability.