I'm confused.
In my
Java application, I use -Xms33m and -Xmx33m to set a fixed, 33-megabyte heap.
I expected that Runtime.maxMemory() and Runtime.totalMemory() would return 33 megabytes (as a long). However, I actually get 33600 kilobytes for totalMemory() and 100352 kilobytes for maxMemory().
I checked my kilobyte conversion, by looking at the values in bytes. It's OK.
I also checked that changing the -Xmx value does affect the returned value. For instance, -Xmx256m gives maxMemory() as 327680 kilobytes (and totalMemory() almost unchanged).
What is going on?
[ February 24, 2006: Message edited by: Peter Chase ]