Originally posted by Ernest Friedman-Hill:
The memory allocation from the OS can grow, but can never shrink. Free memory is returned to Java's internal heap, but never to the OS.
This can provide insight in to memory usage for debugging purposes. Aside from that it is precisely useless.
Originally posted by Jayesh Lalwani:
Wouldn't this be considered a "flaw" in java? If I have a memory intensive operation running 1% of the time, and normal operations take just 10% of peak memory, then Java would hold 90% of memory which would be unused for 99% of the time. Wouldn't it be better if Java just returns the memory back to the OS?
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton