Memory Limit for Jython

ぐ巨炮叔叔 提交于 2019-12-07 18:21:23

问题


How can I set the JVM memory limit (-Xmx option for Java) for my Jython program?

I understand that Jython 2.5 introduces the -J option in order to send options to the JVM:

jython -J-Xmx8000m

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


回答1:


You could just 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:\...



回答2:


You could set environment variables JAVA_OPTIONS (for jython < 2.5) or JAVA_MEM for jython 2.5 e.g.:

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


来源:https://stackoverflow.com/questions/5065840/memory-limit-for-jython

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!