I am playing around with Java, parameter -Xms and class Runtime.
I see that JVM allocates about 15% of the memory that is available - regardless how much it is.
Runtime rt Runtime.getRuntime ();
long total = rt.totalMemory ()
long free = rt.freeMemory ();
That is the case if I start my programm with paramter
-Xms4000m
as well as with
-Xms90m
I see the difference of Xms in the result of totalMemory.
I understand the strategy of allocating more from the beginning to avoid expensive reallocation.
But I do not know if that is in place here AND how I can meter the real memory-consumption of my program.
-Xmxinstead?