[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Possible Memory Leak in Batik?
From:       ml () mherrn ! de
Date:       2013-06-19 13:32:04
Message-ID: d5ee4405f7630b279f29b0c6adff66f3.squirrel () sec-ssl ! de
[Download RAW message or body]

Hi,

I have an application that contains an SVGCanvas on which it creates a
document and paints some objects. These object are modified each minute.
Since it is much easier to just newly create these objects with the new
values instead of modifying them, I create them again and replace the
original ones with the new ones.

However that leads to an increasing memory usage. I have attached an
example application that shows the effect. It displays a JFrame with a
JSVGCanvas that paints 100 rectangles that are positioned in relation to
the current time.
It is updated every 200ms. This application consumes more and more RAM
until an OutOfMemoryError is thrown.

It seems that the memory is even huger when additionally resetting the
document on the Canvas, with for example:

  canvas.setDocument(canvas.getSVGDocument());

Attached are also two screenshots I took with the Netbeans profiler.
The first one shows the memory usage of this sample application shortly
after the application start.
The second one shows it after around 10 minutes later.

However the most memory in this case is used by a LinkedList. In my real
application it seems that float[] is the mostly used object that gets more
and more.

Regards
Marco
["MemTest.java" (application/octet-stream)]
["screenshot1.png" (image/png)]
["screenshot2.png" (image/png)]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic