To Test the max heap size and max permgen space, As per reply suggested by Gilli at Max amount of memory per java process in Windows?, i wrote a simple java class with main method just printing system out
when i ran the class from Console with below param it ran fine but with 2048 it gave the error could not reserve Could not reserve enough space for object heap. It means for my system max heap size is allowed somewhere between 1536 to 2048
java -Xms1536m -Xmx1536m TestJVMParam
As per link at http://publib.boulder.ibm.com/infocenter/javasdk/tools/index.jsp?topic=/com.ibm.java.doc.igaa/_1vg00014884d287-11c3fb28dae-7ff6_1001.html, it is said
When running 64-bit Java, the memory space provided by the operating system to the Java process is very large. You can therefore assume that no limit is imposed on the maximum size of the Java heap because of the contention of memory resource between the Java heap and the native heap.
So i have 8 GB of memory why VM Could not reserve enough space for object heap?
Now second thing i want is to find max permgen size for my system. So i ran the same program with below paramters
java -Xms1536m -Xmx1536m -XX:PermSize=128m -XX:MaxPermSize=128m TestJVMParam
but again it says Could not reserve enough space for object heap. How is that possible as i have 8GB RAM with windows7 64 bit os. And its not allowing even 128m for permgen? i am sure i am missing something here but not able to figure it out?