BTW, although this change was not motivated by this I believe this fixes
a memory leak. But I'll have to verify first. The effect of the
removeContext() call is that all images associated with a user agent
will be moved into a WeakHashMap where they can be picked up by the GC.
If this isn't done the image cache keeps accumulating Context instances
for each processing run.

On 16.08.2005 09:33:10 jeremias wrote:
> Author: jeremias
> Date: Tue Aug 16 00:33:05 2005
> New Revision: 232950
> 
> URL: http://svn.apache.org/viewcvs?rev=232950&view=rev
> Log:
> Notify image cache about the expiration of a user agent (i.e. processing run).
> 
> Modified:
>     xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java   
> (contents, props changed)
> 
> Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java
> URL: 
> http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java?rev=232950&r1=232949&r2=232950&view=diff
> ==============================================================================
> --- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java 
> (original)
> +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java Tue 
> Aug 16 00:33:05 2005
<snip/>
> +        
> +        //Notify the image factory that this user agent has expired.
> +        ImageFactory.getInstance().removeContext(this.userAgent);
<snip/>

Jeremias Maerki

Reply via email to