You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2007/02/15 18:37:23 UTC

DO NOT REPLY [Bug 41626] New: - JSVGCanvas has memory leak problem when resizing the component

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41626>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41626

           Summary: JSVGCanvas has memory leak problem when resizing the
                    component
           Product: Batik
           Version: 2.0
          Platform: HP
        OS/Version: Windows 2000
            Status: NEW
          Severity: major
          Priority: P2
         Component: SVGGraphics2D
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: bulutoprak@hotmail.com
                CC: bulutoprak@hotmail.com


Continuously resizing the size of the canvas is causing the memory to be leaked.
Calling garbage collector does not fix the problem. To see the effect of memory
leak, continously call the setSize method of the canvas and let the size grow. 
For example: call increaseSize many times and decrease size. Each time memory
increases. Calling garbage collector reduces a little but in total always memory
is increasing. Note that you should test the code with a large svg document so
that you can see the effect more quickly.

increaseSize()
{
 Dimension size = svgCanvas.getSize();
 size.width*= 1.3;
 size.height*= 1.3;
  svgCanvas.setSize(size);
}  

decreaseSize()
{
 Dimension size = svgCanvas.getSize();
 size.width/= 1.3;
 size.height/= 1.3;
  svgCanvas.setSize(size);
}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41626] - JSVGCanvas has memory leak problem when resizing the component

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41626>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41626


cam@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEEDINFO




------- Additional Comments From cam@apache.org  2007-09-24 20:21 -------
OK I finally got some time to look at this, but was unable to reproduce the
problem.  This is what I tested with:

import java.awt.Dimension;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.JFrame;
import org.apache.batik.swing.JSVGCanvas;

public class Test {
    public static void main(String[] args) {
        JFrame f = new JFrame("test");
        f.setSize(300, 300);
        f.getContentPane().setLayout(null);
        final JSVGCanvas c = new JSVGCanvas();
        f.getContentPane().add(c);
        c.setSize(100, 100);
        c.setURI("file:/home/cam/workspace/batik-app/test.svg");
        f.setVisible(true);
        TimerTask tt = new TimerTask() {
            double factor = 1.5;
            public void run() {
                Dimension size = c.getSize();
                size.width *= factor;
                size.height *= factor;
                c.setSize(size);
                factor = 1 / factor;
            }
        };
        Timer t = new Timer();
        t.schedule(tt, 5000, 1);
    }
}

It might be that I'm not using a particular feature in the SVG document that
causes the memory leak.  Do you have a self-contained program/document that does
exhibit the leak?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41626] - JSVGCanvas has memory leak problem when resizing the component

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41626>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41626


cam@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Additional Comments From cam@apache.org  2007-03-02 02:50 -------
Hi.

Yeah I tried (briefly) to reproduce this yesterday, but had no success.  I did
manage to get OutOfMemoryErrors by resizing the canvas too large (because there
wasn't enough heap space for a buffer covering the entire canvas), but not just
from repeatedly growing/shrinking the canvas.

I'll investigate more soon.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41626] - JSVGCanvas has memory leak problem when resizing the component

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41626>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41626





------- Additional Comments From bulutoprak@hotmail.com  2007-03-02 01:47 -------
Is this bug group being read by anyone? There is no clue if someone has read the
bug i reported.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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