Possible Memory Leak in Batik?
[email protected] Wed, 19 Jun 2013 15:32:04 +0200 (CEST)
| Newsgroups | gmane.text.xml.batik.user |
|---|---|
| Message-ID | <[email protected]> |
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 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
MemTest.java
(application/octet-stream, 3.8 KB) - not displayed
screenshot1.png
(image/png, 45.6 KB) - not displayed
screenshot2.png
(image/png, 52.7 KB) - not displayed