1

Is there anyway to limit the amount of memory that the Jython interpreter uses?

I've looked into trying to limit the memory usage from inside of the python script but I can't find a cross platform method of doing that.

interpreter = new PythonInterpreter();
interpreter.setMemoryLimit(1024) //something like this for example
interpreter.execfile("mycode.py");
Kuliu
  • 171
  • 2
  • 12
  • I think this can only be done from the command line: `-Xmx` will set your maximum memory for a JVM instance. C.f. https://stackoverflow.com/questions/1493913/how-to-set-the-maximum-memory-usage-for-jvm – markspace Sep 08 '17 at 02:09
  • @markspace Yeah that will limit the entire JVM instance like you said. That's a no can do for my application. – Kuliu Sep 08 '17 at 02:45
  • Does *any* Java library allow you to do this thing? – davidrmcharles Sep 08 '17 at 04:11
  • @DavidCharles Not that I know of. Do you have any recommendations? – Kuliu Sep 08 '17 at 14:48

0 Answers0