xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Delmelle <andreas.delme...@telenet.be>
Subject Re: Memory Leak in PropertyCache: need ideas
Date Fri, 22 Aug 2008 16:03:33 GMT
On Aug 22, 2008, at 12:06, Jeremias Maerki wrote:

> I think I got it now. I'll clean up the code now, do multi-threading
> tests now and then prepare a patch for review.
>
> Just a question in the meantime: What's the purpose of the hash 
> (Object)
> function in PropertyCache? It seems to just hash a hash code. At any
> rate, when I made sure that I always worked with the hashed hash code,
> the whole thing suddenly started working.

This is borrowed from Sun's java.util.HashMap. It defends the map  
against 'bad' hashCode() implementations (that is: it guarantees  
proper distribution over the buckets, regardless of the quality of  
the hashCode() implementation)

>
> BTW, I've upped the minimal bucket count to be equals to the segment
> count so a lock on a segment is always the equivalent of a lock of the
> set of buckets assigned to the segment. That allows more efficient
> cleaning code.

Makes sense.


Cheers

Andreas

Mime
View raw message