Originally posted by Paul Sturrock:
Physical memory management is the domain of the operating system. It might free the memory up in physical memory; it should free the memory in virtual memory.
(For the Sun JVM...)
When garbage collection happens, the JVM usually does not free any virtual memory. The Java heap is some virtual memory that the JVM has obtained from the OS, and the JVM mostly works with this constant amount of heap, regardless of how much of the heap is actually used by active Java objects.
Depending on some settings (-XXMinHeapFreeRatio), the JVM does ask for more virtual memory from the OS for the Java heap, when the Java heap nears fullness with active objects. Depending on some other settings (-XXMaxHeapFreeRatio), the JVM may occasionally release some of the Java heap, if it is getting too empty.
[ May 24, 2007: Message edited by: Peter Chase ]