When does garbage collection occur?

Answer the question!thanks
[47 byte] By [fsaidane] at [2007-9-26 11:17:15]
# 1

Sometime after a objects become unreachable and before the memory allocator runs out of memory, the garbage collector will run. You have no way of controlling or knowing when that will be. There is no reason to.

For some reason, even though many programming languages have garbage collection, people seem to regard Java's garbage collection as something they need to "understand" and control. Garbage collection is best left up to the garbage collector -- that's its job, and just let it work.

schapel at 2007-7-2 0:20:33 > top of Java-index,Java HotSpot Virtual Machine,Specifications...