Memory limit for jython

How to set a limit on JVM memory (-Xmx option for Java) for my Jython program?

I understand that Jython 2.5 represents the -J parameter to send JVM parameters:

jython -J-Xmx8000m

However, I need to work with Jython 2.2a0 on java1.6.0_23 , which does not have this option.

+3
source share
2 answers

You can simply edit jython.bat (windows) or jython (Linux) and add it.

"C:\...\java.exe" -Dpython.home="C:\..." -classpath "C:\...

to

"C:\...\java.exe" -Xmx1024m -Dpython.home="C:\..." -classpath "C:\...
+5
source

You can set environment variables JAVA_OPTIONS(for jython <2.5) or JAVA_MEMfor jython 2.5, for example:

alias jython1G="JAVA_OPTIONS=\"-Xmx1000m $JAVA_OPTIONS\" /usr/bin/jython"
+14
source

Source: https://habr.com/ru/post/1793586/


All Articles