I tested with -Xmx1024m -server in SUN jdk 1.4.2
Runtime.getRuntime().maxMemory() returns a value that is slightly more than 11 MB less than 1 GB
My guess would be that some of the memory is set aside for other purposes inside the JVM.
The SUN documentation for the -Xmx whitch says that it sets the max size of the "memory allocation pool" it does not promise any specific split between heap, stack, jvm internal use, heap and stack for sun classes etc.
> The SUN documentation for the -Xmx whitch says that it sets the max size of the "memory allocation pool" it does not
> promise any specific split between heap, stack, jvm internal use, heap and stack for sun classes etc.
Really? java -X
<snip>
-Xms<size>set initial Java heap size
-Xmx<size>set maximum Java heap size
-Xss<size>set java thread stack size
The values for -Xmx64M posted give 63.5625 (63 9/16), rather than 63: I was wondering whether integer division was to blame and the answer is "partially". The overall answer seems to be that the documentation is inconsistent.