Originally posted by pra kamat:
Does anybody have an idea how they might be doing this.
By calling System.gc(). Most of the time, System.gc() will indeed return some memory -- often quite a lot. It will never grind away until every last byte is reclaimed. And in theory, it can simply do nothing. But the reality of it is that calling System.gc() frees up a bunch of memory.
Is this actually useful in some way? No, not really, most of the time; just gives you the warm fuzzies, and as you say, looks nice on a graph. As soon as the heap filled up, the GC would run automatically, anyway.