xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46319] OutOfMemoryError after generating several thousand pdfs
Date Tue, 02 Dec 2008 23:18:34 GMT

--- Comment #9 from Andreas L. Delmelle <adelmelle@apache.org>  2008-12-02 15:18:33
PST ---
(In reply to comment #7)
> Profiling shows me a growing number of allocations of the following class:
> org.apache.fop.fo.flow.Marker$MarkerAttribute 
> Although the instances seem to be referenced from java.util.WeakHashMap only
> they don't get garbage collected. 

Ouch! Ugly one. Seems to be a classic mistake, again... Since the instances are
used both as key and value, they are never released and the map keeps growing. 

> What are these Marker classes used for and when should they be released again?

For attributes of fo:markers. They should be released as soon as they are no
longer referenced.

> Is there a way to force their release? 

Quick fix would be to modify the code, at line 381 in Marker, and change it to:

attributeCache.put(new java.lang.ref.WeakReference(newInstance), newInstance);

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message