Whoops, please ignore the patch I just sent, I made a mistake.. :-[

Chris Bowditch wrote:
Jeremias Maerki wrote:

On 20.07.2007 12:51:33 Chris Bowditch wrote:

Jeremias Maerki wrote:


On 20.07.2007 11:52:15 Andreas L Delmelle wrote:

<snip/>

In addition to that there was a bug in FixedLength.equals() that made
the caching effect-less:
http://svn.apache.org/viewvc?view=rev&rev=557934

That was the most likely cause. The equals() method returning false because of this, would keep on creating separate instances. How they would be leaked into a subsequent run is not quite clear to me, though...


Because of the bug in PropertyCache. The two bugs just add to each other.

Thanks for spotting this bug in FixedLength.equals(). I rebuilt fop.jar and started a fresh profiling session. After 5000 renderings with only 16Mb the heap is staying around 3Mb. The number of FixedLength and WeakHashMap$entry object is staying fixed at around 300. Hip Hip Hooray!!!


But you're running the same document over and over again, right? In that
case, the WeakHashMap doesn't grow because the cached instances are
always reused. That doesn't address the fact that the instances are
still not releasable. The memory leak is still there. That's why it's so
extremely important to be so damn careful about using static variables.

You are right of course. So if we ran lots of different documents with a very high number of variations in FixedLength then the memory leak still exists. It does sound to me from what you've been saying about the WekHashMap that more work in this area is still needed.

<snip/>

Chris




Reply via email to