Tomcat 7 PermGen Space or Failed to Create JVM

337 views Asked by At

I'm currently searching for any help about this.
I'm trying to start a Tomcat 7 server, but I only get PermGen Space exception.

I tried to change the XXMaxPermSize value, but when I change it, I get a Pop Up at launch of my Eclipse :

"Failed to Create the JVM"

I already had this error before (the Failed to Create the JVM), and it appeared suddenly. Never changed the configuration of my eclipse, but one day to the other, this happened and needed to change de memory allocation in my .ini file.

It's perfectly fine to run Tomcat 6, but I guess Tomcat 7 is way more consuming

Here is my Eclipse .ini :

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-vm
C:/Program Files (x86)/Java/jdk1.6.0_45/bin
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms384m
-Xmx1024m

The problem is coming from the launcher.XXMaxPermSize.
Impossible to increase the value, otherwise, Eclipse just won't launch.
It launches with 256M but crashes with 512...

This can't be a Hardware limitation though since my PC got 8G RAM.

Any idea? Am I missing something obvious?

3

There are 3 answers

0
Gaëtan On BEST ANSWER

Problem solved :

4
Michael On

On Windows, by default, 32-bit processes can only address up to 2 GiB of memory (even if you have much more RAM).

With 512 MiB perm, plus a 1 GiB heap along with the JVM / library overhead you're likely to be exceeding this.

If you run this from the command line:

java -version

You'll see an output like this:

java version "1.x.0_xx"
Java(TM) SE Runtime Environment (build 1.x.0_xx-bxx)
Java HotSpot(TM) Client VM (build 25.31-b07, mixed mode, sharing)

A 64-bit JVM would look like this:

java version "1.x.0_xx"
Java(TM) SE Runtime Environment (build 1.x.0_xx-bxx)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

If it's on a 64-bit system, upgrade to a 64-bit JVM (although it is possible to configure Windows to allow bigger 32-bit processes on a 64-bit system, the 64-bit JVM is the preffered approach).

See this answer for further details:

https://stackoverflow.com/a/9533056/575766

You should also know that you can request arbitrary values for your perm space (300, 384, 412 etc.). With some experimentation, you may find you have enough space to start the process with the 2 GiB limit anyway.

1
Gab On

Beware of parameters declaration order in the eclipse.ini, I already noticed that some parameters are not supported everywhere, for example, you may want to try moving the -vm line at the bottom of the file (after the -vmargs)