xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hennebert <vhenneb...@gmail.com>
Subject Re: [PATCH] Freeing area tree memory
Date Mon, 13 Oct 2008 11:27:22 GMT
Hi Dario,

Dario Laera wrote:
> Hi all,
> 
> I wrote a patch that fixes a memory leak making FOP freeing areaTree
> memory after rendering (or caching) a page within a page-sequence
> processing: with this patch since the first page areaTree has been
> completed, the memory consumption is almost constant until the end of
> the page-sequence. With some more lines of code that frees ChildContext
> and some peripherals LM the amount of memory used even decreases.
> I didn't get any error in the test I run, I ask the list if this patch
> do have side effects I didn't catch. In particular, it seems to me that
> the changes in BlockLM and LineLM are the more unsafe.

A good way to test your modifications is by running the test suite:
    ant junit
While this doesn’t assure you that your patch is 100% correct, this at
least gives you a good indication. Now, if I run the test suite on
a patched Trunk I have an infinite loop somewhere, so there seems to be
a problem in your modifications. You’re probably too aggressive in
freeing objects that are actually re-used. Note that the addAreas method
are called once per page on which the object relies; so you have to be
careful to not release information that may still be needed for
following pages. Sorry I can’t study your changes in more details at the
moment.


As a side note, watch for tab characters in your source files; they are
illegal in the FOP project. Don’t forget to run checkstyle before
submitting a patch. See here for information about how to set up the
Checkstyle plugin in various development environment:
http://wiki.apache.org/xmlgraphics-fop/FOPIDESetupGuide


Thanks,
Vincent

Mime
View raw message