Re: svn commit: r487972 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java

2006-12-23 Thread Andreas L Delmelle

On Dec 20, 2006, at 21:10, Andreas L Delmelle wrote:


On Dec 20, 2006, at 20:45, Jeremias Maerki wrote:


I wonder about the effect of that on very long running server
applications producing all kinds of different documents. There's no
chance for freeing instances here if memory is needed. I assume  
that in
this case the set of instances will still remain relatively small.  
But
still, this is memory that is never freed and some instances may  
never

be reused after a particular rendering run.


snip /
Anyway, I'll see if I can adapt to use WeakHashMap too. Should work.


Done. Committed to the release branch as well.

Cheers,

Andreas



Re: svn commit: r487972 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java

2006-12-20 Thread Andreas L Delmelle

On Dec 20, 2006, at 20:45, Jeremias Maerki wrote:


I wonder about the effect of that on very long running server
applications producing all kinds of different documents. There's no
chance for freeing instances here if memory is needed. I assume  
that in

this case the set of instances will still remain relatively small. But
still, this is memory that is never freed and some instances may never
be reused after a particular rendering run.


True indeed. My bad. Richard was a bit smarter, and used a  
WeakHashMap, so that the instances that are no longer referenced can  
be released.
OTOH, since the access to the propertyCaches is not synchronized in  
Richard's patch, I'm wondering whether or not the possibility arises  
that two parallel threads issue a put() on the Map at the same time  
for an equal instance...?


Maybe we're both slightly off...

Anyway, I'll see if I can adapt to use WeakHashMap too. Should work.

Thanks for the vigilance!

Cheers,

Andreas