How to set up a really big JVM heap size

jvm

According to the JVM 6 documentation, server class machines receive by default an initial heap size as 1/4 RAM or 1GB. Considering our Solaris 64Bit server has 64 GB, the initial heap size will default in as 256MB. Therefore, I need to set manually the heap size using the XMX parameter for 4GB. Though, when I add "-Xmx4096M", Tomcat does not start. Here is the error message:

Invalid maximum heap size: -Xmx4096M
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.

What should be my command line parameters to allow my heap to grow up to 4GB?

Best Answer

Thanks for all your input, guys! Though, the output of my java -version mentions mixed mode which means that it is 64 bits. The real solution is adding -d64 to force it to run in 64 bits and therefore allocate the 4GBs.