2

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

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

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] Error occurred during initialization of VM [2009-06-18 01:39:44] [info] Could not reserve enough space for object heap [2009-06-18 01:39:44] [info] [2009-06-18 01:39:44] [395 javajni.c] [error] CreateJavaVM Failed

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

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

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

Robert Campbell
  • 6,848
  • 12
  • 63
  • 93
  • 1
    What is the operating system? How much memory the machine has? How much do you allocate for the heap and stack size (Xmx Xms Xss)? – David Rabinowitz Jun 18 '09 at 05:55

3 Answers3

4

Try to give it a bigger heap with -Xmx512m (this will give 512 MB)

What other memory parameters do you use? How much memory is there in your machine? Are you on a 32-bit or 64-bit machine?

Gábor Hargitai
  • 544
  • 2
  • 4
  • 1
    That makes sense, since your 128MB perm size are part of the heap, so you need to increase the total heap size as well. – Thilo Jun 18 '09 at 05:59
2

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

Amot
  • 323
  • 1
  • 2
  • 7
  • I didn't know the two were linked and this was my problem. I had maxed out my Heap size so there wasn't any room to increase PermGen. When I scaled back my Heap size I was then able to increase my PermGen space. – Robert Campbell Nov 06 '09 at 06:16
1

I have 2GB of memory and I run tomcat with settings -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m. This usually runs fine.

Lauri Larjo
  • 314
  • 1
  • 8