Memory leak in JPython beta 2

Serial # 19781010 rhays at interaccess.com
Tue Sep 28 07:33:58 EDT 1999


I run the following program for about 200+ iterations and see 
a pretty reasonable memory leak; after 800 passes, the leak is large.
Has anyone else seen this with the beta2 version?  Does the new beta 3
version fix the (at least apparent) memory leak?  I'm running JDK
1.1.7 on HP-UX 10.20.

This is a serious problem for us as we want to use JPython to
translate XML formats for a large number of messages.

=== justInterp.py ===

def execute():
    return

=== justInterp.java ===

import com.sun.xml.tree.*;
import org.w3c.dom.*;

class justInterp
{
    public static void main(String [] args)
    {
        String script = "justInterp.py";
        for (int i = 0; i < 100000; i++)
        {
            System.out.println("Executing execute() for the " + i +
"th time");
            org.python.util.PythonInterpreter interp = new
org.python.util.PythonInterpreter();
            interp.execfile(script);
            interp.exec("execute()");
            interp = null;
            System.gc();
            try
            {
                Thread.sleep(500);
            }
            catch (Exception e)
            {
            }
        }
    }
}

=== end files ===

Thanks and have fun! - Bob





More information about the Python-list mailing list