Garbage Collector in Java is also called Automatic Memoty Management. In simple words, it's used to free the heap memory. It works on objects that are no longer references.
Request Garbage Collector (GC) Methods:
System.gc(); -> Request GC to run
Runtime.getRuntime().gc(); -> Way to request GC
Ways to make Object eligible for GC
Nulling a Reference Variable.
Re-assigning a reference variable.
Island of Isolation.