This content has been marked as final. Show 1 reply
I don't know what the "top" command is and I don't know what operating system you're on, but let me tell you how it works on Windows.
The VM gets a contiguous piece of address space at start up. That's very different from memory (working set, page file space, etc.).
Yes, it does give memory back. If you look at the java-tool documentation and follow the links to the non-standard options (they're hard to find. There's the -X non-standard options and the -XX very non standard option; they're where the action is) you'll find some that control when the VM/gc gives back memory.