Message5363
Executing the python script repeatedly that imports another python class
causing OOM: PermGen exception.
After investigating this further the class org.python.core.PyType has a
static "class_to_type" map that never gets cleaned up and holds
references to generated class files and that does not allow those
classes to be clean up from PermGen.
class_to_type has thousands of references to PythonPOSIXHandler$<some
number>. I believe the problem happens when python script imports a
class defined in python.
The code that causes the OOM after about 30 min with -XX:MaxPermSize=32m
is included.
Java class with the main method to run:
public class JythonProblemTest {
public static void main(String[] args) throws Exception
{
while(true)
{
PythonInterpreter inter = null;
try
{
inter = new PythonInterpreter(null, new PySystemState());
inter.execfile("python_src/test.py");
}
finally
{
if (inter!= null)
{
inter.cleanup();
}
}
}
}
}
---------------------------------------------------------------
Python script to be executed by Java main method:
from os import path
class MyClass(Exception):
'''
classdocs
'''
def __init__(self):
pass
if __name__ == '__main__' or __name__ == 'main':
pass |
|
Date |
User |
Action |
Args |
2009-12-08 21:03:09 | rkurin | set | recipients:
+ rkurin |
2009-12-08 21:03:09 | rkurin | set | messageid: <1260306189.54.0.532066560048.issue1522@psf.upfronthosting.co.za> |
2009-12-08 21:03:09 | rkurin | link | issue1522 messages |
2009-12-08 21:03:08 | rkurin | create | |
|