List Info

Thread: Memory-Leaks in Batik




Memory-Leaks in Batik
user name
2006-12-19 12:38:22

Hi,

once again a problem using batik:
I have a JSVGCanvas and often load another SVG with canvas.setURI(svgFile.toURL().toString()); into it. The consequence is a more or less heavy memory-leak, whatever Batik-Version I use. The following observations can I report:

1) using batik-1.6 with SVGs only containing one referenced PNG, everthing seems ok.
2) using batik-1.6 with pure SVGs the memory-leak first starts up quiet fast (in MB-Steps) to an undefinded threshold than the memory increases very slow

3) using batik-Trunk with pure SVGs the memory increases quiet fast although the Heap-Size is set to 128MB.

Using quite big SVGs (up to 1.2MB) this can be monitored easy. Using the test-sources shipped with batik, this behaviour can also be observed but the memory consumation is quite low. It seems that the memory level settles down after a longer time (half an hour), however batik than uses more than 100MB or more of memory.

Perhaps you can have a look at this behaviour.

Thanks

Florian

Attached is a small sample application I used to test the JSVGCanvas.

<<JSVGCanvasTester.java>;>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Florian Pepping Wincor Nixdorf International GmbH
Banking Division&nbsp; &nbsp;   ;  Product Development (PSD5)
Phone: +49 5251 693 6471   ; &nbsp; &nbsp; Heinz-Nixdorf-Ring 1
Fax: +49 5251 693 6309  D-33106 Paderborn
florian.peppingwincor-nixdorf.com">florian.peppingwincor-nixdorf.com &nbsp; &nbsp;   &nbsp; &nbsp;  http://www.wincor-nixdorf.com


Memory-Leaks in Batik
user name
2006-12-19 13:40:20
Memory-Leaks in Batik
user name
2006-12-20 07:00:44
Hallo Thomas,
 
yeah you're right, that was not a memory-leak. After another few hours of investigation I could verify, that the memory consumption always has a limit. Although the behaviour of the garbage collector is very strange. You have to wait up to half an hour, before the memory-limit is reached (not mentioned, that the JConsole is a very helpful tool   )
 
Ok, thanks for your reply and pointing me into the right direction.
 
Florian


From: thomas.deweesekodak.com [mailto:thomas.deweesekodak.com]
Sent: Tuesday, December 19, 2006 2:40 PM
To: batik-usersxmlgraphics.apache.org
Cc: batik-usersxmlgraphics.apache.org
Subject: Re: Memory-Leaks in Batik


Hi Pepping,

"Pepping, Florian" <florian.peppingwincor-nixdorf.com>; wrote on 12/19/2006 07:38:22 AM:

> once again a problem using batik:
> I have a JSVGCanvas and often load another SVG with canvas.
&gt; setURI(svgFile.toURL().toString()); into it. The consequence is a
> more or less heavy memory-leak, whatever Batik-Version I use. The
> following observations can I report:

   [...]
>  It seems that the memory level settles down after a longer time
> (half an hour), however batik than uses more than 100MB or more
> of memory. Perhaps you can have a look at this behavior.

   This doesn't sound like a problem.  This is just how
Garbage Collection works.  

   In Java you don't delete/free memory, the JVM automatically
detects memory that is no longer referenced and free's it for
you.  However this detection can be time consuming so it
generally doesn't look for work until memory is almost full.
So if memory consumption is settling then there isn't a memory
leak.
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )