Domanda

When starting tomcat I get the error

Not able to reserve enough space for Object Heap

Not able to create Java virtual machine

I googled a bit and it seems that this is a common problem but the fix which was mentioned everywhere does not work for me.

Every place where this problem was mentioned said "set CATALINA_HOME or JAVA_OPTS." I set the values for both the variables and reserved enough space for head and permsize but still I am facing the same issue.

On a lighter node: I have verified that there is enough space available for allocation.

I am using 32 bit stack and I am setting following values for JAVA_OPTS and CATALINA_OPTS

-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m

È stato utile?

Soluzione

Java on 32bit Windows requires a contiguous block of memory - windows32 cannot give too big a block of memory, AFAIK max 1.5G (this is memory back from the XP times), but only that much if the memory is not too fragmented already (yes, I know, sounds weird nowadays).

So, you might try to reboot your machine and start java/tomcat first thing, before you start other applications. Another option is to provide less memory (try how much is required vs. available).

Also, for production settings, I always recommend to have -Xms and -Xmx to have the same size: If something goes wrong, you'll get the result immediately, plus the contiguous block of memory has been allocated already.

Altri suggerimenti

Try changing Tomcat Arguments at "Open launch configuration".

At Eclipse, at Servers view, double click on the server, click "Open launch configuration" link. At the screen that appears, clic select "Arguments" tab, you will see a value ending similar to: -Dproperties.path=C:/dgoj/properties/local -Xms512m -Xmx1024m -XX:MaxPermSize=512m

You only have to modify the last value, XX:MaxPermSize, to set it as:

XX:MaxPermSize=256m

Tomcat should start fine now

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top