Below command will help you to identify the maximum memory heap size than can be allocated to a JVM process.
java -mx[value]m -version
Start with a higher value like 4G or higher and slowly cut down to the maximum allowed value.
Sample
$ java -mx4096m -version
Invalid maximum heap size: -Xmx4096m
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.
As you can see my system can't support 4GB for a JVM.
Now lets reduce to a lesser value like 3GB
$ java -mx3072m -version
Invalid maximum heap size: -Xmx3072m
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.
As you can see my system can't support 3GB for a JVM.
Now again lets reduce to a lesser value like 2.5GB
$ java -mx2560m -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)
Now its clear that the maximum allowed value is 2.5 GB.
No comments:
Post a Comment