xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ulric.cuvel...@1plus3.com
Subject Memory leak in tooltips ?
Date Mon, 23 Mar 2009 13:45:40 GMT

hi all,

I'm trying to avoid a memory leak in my application, and after tracking
all possibilities in my code, I wonder if the problem is not in batik's

The problem appears in a dialog with a Jtree and a jsvgCanvas.
Jtree is used to select the svgDocument.

Selecting a node in jtree starts a new document creation each time.

The JVM is started with -verbose:gc and -Xmx384m

In my tests, the jtree only contains 2 documents (a small one and a
second big enough to show the problem (svg document takes about 200Mo 
to render, so I can't have 2 references at the same time on the big document).

I can switch without any problem from one document to the other using
jtree as long as I want. Gc gets back to a floor of 10Mo, when necessary.

The problem appears on the big document when mouse is just over an object which
have a <desc> or <title> item. This shows a tooltip (and I suppose batik
keep a reference on last tooltip shown). I have no listener for
mouseover in my program and so no reference to ti.

I can go back to the small document, but coming back again to the big
document is impossible. gc cannot free memory (stays around 350Mo)

In the same run, and before gc is completely stucked, I select small
document again, which is rendered correctly. I put the mouse over an
object with a tooltip (so I think the last tooltip shown is replaced
with a reference to an object of the small document)

Then selecting again the big document causes a correct rendering, gc
frees memory correctly.

Batik is in version 1.7

I tried to patch as described here :


but nothing changed.

I checked my code many times and suppress all fields refering to
svgElements and svgdocuments for testing

Can someone give me a hint ? is there a workaround like
canvas.setLastTooltipShown(null) ?

thx for help

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message