Apologies, Jython cleans up 100% after a while, it seems only JEP is at fault here...

On Thu, Feb 25, 2010 at 11:47 AM, Mike <mcanix@gmail.com> wrote:
Hi All

I'm running a custom Execution Environment which can invoke both a native process (Runtime.getRuntime().exec()) and the built in Java6 ScriptEngineManager.

I have added jython and jepp successfully to the ScriptEngineManager and they both invoke 100%, however, when running over time I've noticed a massive memory leak when using the embedded ScriptEngine.

This memory leak does not present itself when running via a native process, so I assume that it has something to do with the ScriptEngine self. I haven't managed to run a profiler on the system since I'm having issues running TPTP.

What is best practice for cleaning up after a ScriptEngine has done its work?

Why would it leak so much (50mb/second) for Jep and slightly less for Jython?

Is there a way to clear the bindings/context after the engine has done its work?

This is my first time using the Java6 ScriptEngine so I might have issues with cleanup etc...


Regards,

Mike


Versions:

Java: 1.6.0_14
Jython: 2.5.1 built from SVN (Needed to set variables within the PythonInterpreter)
Jep: 2.4