Re: svn commit: r487972 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java
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. 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
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
Re: svn commit: r487972 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java
I know I'm f**ing late to chime in here. But I haven't read all content on fop-dev from this months, yet, and I'm currently going through the SVN changes. Sorry. Anyway... 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. On 17.12.2006 13:00:01 adelmelle wrote: > Author: adelmelle > Date: Sun Dec 17 04:00:00 2006 > New Revision: 487972 > > URL: http://svn.apache.org/viewvc?view=rev&rev=487972 > Log: > Optimization in Marker.java: reduction of distinct MarkerAttribute instances > (see also Bugzilla 41044) > > Modified: > xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java > > Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java > URL: > http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java?view=diff&rev=487972&r1=487971&r2=487972 > == > --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java > (original) > +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java Sun Dec > 17 04:00:00 2006 > +private static final class MarkerAttribute { > + > +private static Map foAttributeCache = > +Collections.synchronizedMap(new java.util.HashMap()); > + > +protected String namespace; > +protected String qname; > +protected String name; > +protected String value; Jeremias Maerki