Issue2501

classification
Title: JAVA_STACK doesn't work
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution: accepted
Dependencies: Superseder:
Assigned To: jeff.allen Nosy List: gsnedders, jeff.allen, zyasoft
Priority: normal Keywords:

Created on 2016-05-20.22:15:23 by gsnedders, last changed 2018-03-28.19:12:27 by jeff.allen.

Messages
msg10859 (view) Author: Geoffrey Sneddon (gsnedders) Date: 2016-05-20.22:15:22
With 2.7.0:

JAVA_STACK=16m jython

gives:

Error: Could not find or load main class 16m

This isn't the expected REPL!
msg10860 (view) Author: Jim Baker (zyasoft) Date: 2016-05-20.22:17:59
Current workaround is to use -J-Xss16m, but this should be fixed.

We also need to document that JAVA_STACK takes whatever is acceptable for Java's -Xss setting; and ideally provide examples/description.
msg11791 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-13.21:04:20
Although it seems logical to me that this should work (Windows, sorry):
PS bugs> $env:JAVA_STACK="16m"
PS bugs> jython --print
java -Xmx512m 16m -classpath ..\..\..\..\..\Jython\2.7.2a1\jython.jar;. -Dpython.home=..\..\..\..\..\Jython\2.7.2a1 -Dpython.executable=..\..\..\..\..\Jython\2.7.2a1\bin\jython.exe -Dpython.launcher.uname=windows -Dpython.launcher.tty=true org.python.util.jython

In fact, JAVA_STACK has to include the "-Xss" part:
PS bugs> $env:JAVA_STACK="-Xss16m"
PS bugs> jython --print
java -Xmx512m -Xss16m -classpath ..\..\..\..\..\Jython\2.7.2a1\jython.jar;. -Dpython.home=..\..\..\..\..\Jython\2.7.2a1 -Dpython.executable=..\..\..\..\..\Jython\2.7.2a1\bin\jython.exe -Dpython.launcher.uname=windows -Dpython.launcher.tty=true org.python.util.jython

The Python and shell launchers both observe this convention. So on the face of it, this is invalid, or a help/documentation bug.

As an enhancement, it would be possible to check for the -Xss and force it in if missing, I suppose. If that's desirable, we should do the same for JAVA_MEM. Thoughts?
msg11861 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-28.19:12:26
I will make the launcher tolerant of either form. I can do this readily for Windows only, but the Unix shell script version needs the same treatment. Leaving open with that intention.
History
Date User Action Args
2018-03-28 19:12:27jeff.allensetmessages: + msg11861
2018-03-13 21:04:21jeff.allensetpriority: normal
assignee: jeff.allen
messages: + msg11791
nosy: + jeff.allen
2016-05-20 22:18:10zyasoftsetresolution: accepted
2016-05-20 22:17:59zyasoftsetnosy: + zyasoft
messages: + msg10860
2016-05-20 22:15:23gsnedderscreate