New Relic Interview Question

How does the Java Garbage Collector works?