This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I imagine it would prevent the collection of any objects, since the finalizer thread will be blocked.
Once, quite early in Java's lifetime, I spent two days trying to understand a deadlock in which one of the two threads involved was the finalizer thread. The subconscious lesson I learned from this was to never do anything non-trivial in finalize() -- this rule has served me well over the years.
Good question dude. As Ernst pointed out, the gc thread will be blocked and no objects marked for finalization in that sweep will be collected until notified. But other gc threads instantiated after this would still run as they are in separate theads.
Hi Vipin, As your program is still running GC will not colelct your objects. Thats why, if you see program running 24x7 (batch programs). Initially for few times will be ok then later we will have memory problem.