Message5812

Author adam.spiers
Recipients adam.spiers, bpedman, matt_brinkley, pjenvey, rkurin
Date 2010-06-15.23:20:54
SpamBayes Score 0.00792658
Marked as misclassified No
Message-id <1276644055.19.0.358187859921.issue1522@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Matt,

Amazing coincidence that you are looking at this at the same time as me!  Although I do see PythonPOSIXHandler duplication, here the main cause of the leak is repeated compilation of the same Jython code via BytecodeLoader, resulting in class_to_type having thousands of keys which are of the form org.python.proxies.foo$bar$<some int>.  I'm not yet sure why compilation is happening repeatedly, nor why Jython takes this monotonically increasing integer approach.

Anyway, here we reached the same conclusion as you, and have in fact hacked PyType, PySystemState, and PythonInterpreter, to track these PyTypes when they are added to this map, and then remove them during PythonInterpreter.cleanup().  This seems to work OK, as long as you remember to invoke that method after every usage of PythonInterpreter!
Maybe doing this from PythonInterpreter.finalize() would be even better.
History
Date User Action Args
2010-06-15 23:20:55adam.spierssetmessageid: <1276644055.19.0.358187859921.issue1522@psf.upfronthosting.co.za>
2010-06-15 23:20:55adam.spierssetrecipients: + adam.spiers, pjenvey, matt_brinkley, bpedman, rkurin
2010-06-15 23:20:55adam.spierslinkissue1522 messages
2010-06-15 23:20:54adam.spierscreate