Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to increase java heap size

I have 16GB RAM on my Linux machine and have set the maximum java heap memory to 4GB using -Xmx4096m argument. But I am getting the following error when i start my process.

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

It works fine when i set the value to 2048m.

Is there any other configuration parameter that i need to change to increase the heap size ?

Thanks in advance!

like image 573
shadowfax Avatar asked Sep 28 '12 10:09

shadowfax


2 Answers

its not only about how much RAM you have

on a 32 bit machine max heap available is 1628MB on a 64 bit machine max heap available is 2^64 (theoretically) but there are limitations

like image 98
Mukul Goel Avatar answered Oct 12 '22 23:10

Mukul Goel


What OS are you using? Take a look at the Oracle Hotspot FAQ. Look out for the following section:

Why can't I get a larger heap with the 32-bit JVM?

If you are using a 32-bit system, lower it to 1.6G. For 64-bit systems, check the supported systems list in the link provided.

like image 45
Daniel Vermaasen Avatar answered Oct 12 '22 23:10

Daniel Vermaasen