I don't know the internals of this particular implementation, but I know
that some JVM implementations never release the memory to the Operating
System, even when the heap was shrunk.
What you see with Runtime.totalMemory is the size of the heap. What you
see
with top is the size of the process, for which the Java heap accounts for
most of the size, but not all (memory allocated by native code, etc).


|