如何在 Windows 中为 jvm 添加 PermGen 空间?我找到了很多关于它的链接?但我不明白我必须在哪里单击并写入新值
2 回答
It is more of a Java runtime (JVM) setting than a Windows one. You configure it by adding the below parameters (example only) to your Java command line.
-XX:PermSize=256m
-XX:MaxPermSize=512m
For example, if you were doing java -jar someapp.jar
, you might have to do java -jar someapp.jar -XX:PermSize=256m -XX:MaxPermSize=512m
.
A common practice is to define the -X
parameters in an environment variable called JAVA_OPTS
and using it in the command lines.
On unix,
export JAVA_OPTS="-XX:PermSize=256m -XX:MaxPermSize=512m"
java $JAVA_OPTS -jar someapp.jar
On Windows,
you can define a Local / System variable similarly.
java %JAVA_OPTS% -jar someapp.jar
You can increase size of PermGen Space by using JVM param -XX:MaxPermSize and -XX:PermSize.