Garbage collection is one of the most important feature of Java. Garbage collection is also called automatic memory management as JVM automatically removes the unused variables/objects (value is null) from the memory. User program cant directly free the object from memory, instead it is the job of the garbage collector to automatically free the objects that are no longer referenced by a program.