Title: JVM memory settings are ignored on GNU/Linux
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: stefan.richthofer, stuckyb
Priority: Keywords:

Created on 2016-11-14.20:33:26 by stuckyb, last changed 2017-01-28.15:15:00 by stefan.richthofer.

msg10987 (view) Author: stuckyb (stuckyb) Date: 2016-11-14.20:42:37
When running jython on Xubuntu 15.10, JVM heap size arguments are ignored.  E.g., I passed -Xmx512m to the JVM in two ways: via the jython launch script as -J-Xmx512m, and by setting the value of the JAVA_MEM environment variable.  In both cases, running jython with the --print option confirmed that the JVM argument was correctly parsed and passed to the call of the JVM.  However, when executing a memory-intensive script, the Java process always used approximate 2.1 GB of RAM regardless of whether I set -Xmx much lower or much higher than 2 GB.

The problem seems to be with the call to os.execvp() in the jython launch script (line 431).  If I have jython print the java command string, then execute this command directly on the command line, the JVM memory limits behave exactly as expected.
msg11040 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-01-28.15:14:59
good you found a workaround. You could alternatively try the CPython-launch script for Jython (bin/; would be nice to know if the issue occurs there as well.
Finally, for Linux you can try LiJy-Launch, a JNI-based Jython launcher (, working by a similar approach like the original Java-launcher.

Do you have an example code-snippet available that demonstrates the memory limit?
Date User Action Args
2017-01-28 15:15:00stefan.richthofersetnosy: + stefan.richthofer
messages: + msg11040
2016-11-14 20:42:37stuckybsetmessages: + msg10987
2016-11-14 20:33:26stuckybcreate