Message5835
Here is the test program I used. One thing to note is that I added an accessor method for PyType.class_to_type so I could print out its size.
-------------------------------------------------------------------------
import org.python.util.PythonInterpreter;
import org.python.core.PySystemState;
import org.python.core.PyType;
public class JythonTestMain
{
public static void runScript() throws Exception
{
PySystemState sys = new PySystemState();
PythonInterpreter pi = new PythonInterpreter(null, sys);
pi.execfile("/path/to/test.py"));
pi.cleanup();
}
public static void main(String[] args) throws Exception
{
//(have tried this for various sizes of 'n')
for(int i=0; i<2;i++)
{
runScript();
System.out.println("class_to_type size:" + PyType.getClassToType().size());
System.gc();
System.out.println("class_to_type size (post-gc):" + PyType.getClassToType().size());
}
}
}
--------------------------------------------------------------------
(Here is the contents of test.py ... the important feature it must have is that it must contain a Python class that implements a Java interface.)
from java.lang import Comparable
class Dog(Comparable):
def compareTo(self, o):
return 0
def bark(self):
print "woof woof"
print Dog().bark() |
|
Date |
User |
Action |
Args |
2010-06-24 23:34:36 | matt_brinkley | set | messageid: <1277422476.65.0.647695252402.issue1522@psf.upfronthosting.co.za> |
2010-06-24 23:34:36 | matt_brinkley | set | recipients:
+ matt_brinkley, pjenvey, zyasoft, bpedman, rkurin, adam.spiers |
2010-06-24 23:34:36 | matt_brinkley | link | issue1522 messages |
2010-06-24 23:34:35 | matt_brinkley | create | |
|