where is the garbage collector thread
posted 13 years ago
The question may not have been intended as advanced, but a detailed answer would be, should someone wish to research it for a specific JVM. The simple answer is in general, we don't really know; that's an implementation detail and generally not our business anyway. Furthermore the JVM is under no obligation to implement GC using a single Java Thread instance; it's extremely possible that GC is being carried out by a native code thread somewhere (note lower-case 't'), and won't appear as part of any ThreadGroup. Also it's probably a mistake to think that there's just one thread doing GC, because GC is a complex system and different aspects of GC occurin a variaety of contexts. I'm guessing that the "Finalizer" thread is part of the system, but not the whole thing. "Reference Handler" - maybe part also. I imagine these threads do specific things as necessary, but still aren't the whole system - most is probably hiding in native code somewhere. For more detail, you'd probably have to go to the Community Source releases to see sample JVM code, and try to locate modules that deal with garbage collection, to see how they're set up.