Ranjan Banerjee explains how the Java garbage collector works, using Hadoop as an example:
The reason why we all love Java is due to the fact that we can be careless with memory creations and the work of cleaning the mess is performed by the JVM. On a high level, Java heap memory is classified into two phases:
1) Young (eden) space
2)Old space
The eden space is where newly created objects goto. There are various algorithms for garbage collection, but all of them try to first free memory from the young space and for those long lasting memory objects, they are transferred to the old space.
One common issue that can be noticed in running Map Reduce Applications are GC overhead limit exceeded.
Read on for more, including where you can find GC logs.