0

After installing the latest Java 7 Development Kit (Java SE 7u11) on my Windows 7 Professional 32bit PC with 4Gb RAM, I noticed I can't allocate much memory for Tomcat.

Whereas these memory settings worked for Java Development Kit 6u38:

set JAVA_OPTS=-server -Xms978m -Xmx978m -XX:MaxPermSize=512m

...when run with jdk7, these settings cause the Tomcat launcher to exit with following error message:

Error occurred during initialization of VM

Could not reserve enough space for object heap

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

I tried lowering the Xms and Xmx settings, and apparently, it won't work with more than 512m:

set JAVA_OPTS=-server -Xms512m -Xmx512m -XX:MaxPermSize=512m

Yet, systeminfo |find "Available Physical Memory" tells me that I have 1200mb available memory.

Has anything changed w.r.t. memory management of Java 7, and does this mean that Java 7 can only work with lower amounts of memory?

Thanks for any advice,

Ron

rvdb
  • 319
  • 1
  • 5
  • 14

1 Answers1

0

Two information that could help you, calculation the memory correctly:

  1. a 32 bit OS can't use more then 3GB RAM, even if there is more installed
  2. Although the memory is allocated for Java, it is "free" at the system info as long as java is not actively using it

If you also have any other java process running (e.g. eclipse?), you won't see the allocated memory of these processes, too.

Rudolf
  • 126
  • 3
  • Thanks for your suggestions. I was aware of the limited memory available. Still, the same memory settings that work with JDK-1.6 produce heapspace errors when Tomcat is launched with JDK-1.7. That's why I'm wondering if memory requirements / handling has changed between these Java versions. – rvdb Jan 31 '13 at 13:53