Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java 1.5 initial heap size and max heap size

843829Oct 5 2005 — edited Oct 5 2005
Hi I am having problems with java 1.5.. whenever I run java or javac i get this error:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

I tracked it down to the JVM trying to set maxheapsize to 1024meg, on this virtual server the max i can allocate is 768m. It is doing this by default according to: http://java.sun.com/docs/hotspot/gc5.0/ergo5.html

"In the J2SE platform version 5.0 a class of machine referred to as a server-class machine has been defined as a machine with

2 or more physical processors

2 or more Gbytes of physical memory

On server-class machines by default the following are selected.

Throughput garbage collector

Heap sizes

initial heap size of 1/64 of physical memory up to 1Gbyte

maximum heap size of � of physical memory up to 1Gbyte

Server runtime compiler

"

And the hardware my virtual server is on has 4 processors and 6+gig of memory. Is there any possible way to change the default settings of initial and maximum heap without manually setting the -Xmx flag on everything? Because anytime i need to install or test scripts I get that error, and would like to globally solve it if possible.

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2005
Added on Oct 5 2005
1 comment
492 views