regarding heap space

Hello all,

I just have one doubt regarding, if Garbge Collecter removes the reference variables which are out of scope... then heap will be fragmented here.... my doubt is then who will take care of defragmetation VM or GC

[235 byte] By [sricharana] at [2007-11-27 10:19:37]
# 1

The garbage collector also packs the heap every once in a while.

-Kayaman-a at 2007-7-28 16:58:46 > top of Java-index,Java Essentials,Java Programming...
# 2

hello kayaman,

thanks for your response......you said that gc also packs the heap .. can i mean some one else(VM) also do this..... if so please tell me when gc act on this and when VM .....

when i read about gc writen by Bill Venners......he given that "In addition to freeing unreferenced objects, a garbage collector may also combat heap fragmentation"

this makes me doubtful........ can u please..

sricharana at 2007-7-28 16:58:46 > top of Java-index,Java Essentials,Java Programming...
# 3

he just states by using the word "may" that a garbage collector isn't guaranteed to do heap optimisation.

It's implementation dependent, but not something you should worry about.

jwentinga at 2007-7-28 16:58:46 > top of Java-index,Java Essentials,Java Programming...