Java Could not reserve enough space for object heap?

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


29 points

'm have installed java sdk 1.5 on a linux CentOS server. If I run java, 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.

How do I solve it?



-1 points

Use this on your linux shell or add this to your .bashrc file:

export _JAVA_OPTIONS="-Xms20m -Xmx64m -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:NewSize=10m -XX:MaxNewSize=10m"

Anonymous's picture
Created by Anonymous
-5 points

Great! It worked.

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.