当我将 PermGen 设置为 128M 以上时,为什么我的 Sun JVM 无法初始化?

问题描述:

我需要增加我的永久代.目前我将以下内容作为命令行参数传递:

I need to increase my PermGen. Currently I pass the following as command line parameters:

-XX:PermSize=128m-XX:MaxPermSize=128m

这有效.但是,如果我尝试增加这些值,我的 JVM 将无法初始化,并出现以下错误:

This works. If I try to increase the values, however, my JVM fails to initialize, giving me this error:

[2009-06-18 01:39:44] [info] 初始化虚拟机时出错[2009-06-18 01:39:44] [info] 无法为对象堆保留足够的空间[2009-06-18 01:39:44] [信息][2009-06-18 01:39:44] [395 javajni.c] [错误] CreateJavaVM 失败

具体来说,我正在尝试在包含的 JRE6 中启动 Tomcat,但我认为这无关紧要.

Specifically, I'm trying to boot up Tomcat in the included JRE6, but I don't think this should matter.

我正在运行具有 2GB RAM 的 Win2k3 VM 映像.我使用带有以下参数的 Monitor Tomcat 应用程序启动 JVM:

I'm running Win2k3 VM image with 2GB of RAM. I boot the JVM using the Monitor Tomcat application with the following parameters:

初始内存池:1024,最大内存池:1536

Initial memory pool: 1024, maximum memory pool: 1536

-XX:PermSize=128m-XX:MaxPermSize=128m-XX:+CMSPermGenSweepingEnabled-XX:+CMSClassUnloadingEnabled-XX:+UseConcMarkSweepGC-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 6.0-Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 6.0-Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 6.0\endorsed-Djava.io.tmpdir=E:\tomcat\temp-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager-Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\logging.properties

Perm Gen 是 Heap 的附加组件,因此请检查进程——您需要有 1.5 GB 以上的 2G 可用空间.

Perm Gen is additive to Heap, so check the processes -- you'll need to have 1.5+ GB of your 2G available.