The Java Virtual Machine (JVM) uses reference counting to track the number of Java objects. Before any object can be collected, the number of references to this object must reach zero. The user program can explicitly delete objects by calling finalize() method. Finalize is a static method in the Object class which is called by Garbage Collector (GC). Finalize method will release all the resources of the object before Garbage Collector will take care of this object. Garbage Collector is the process of cleaning unwanted objects. The process of Garbage Collector will be triggered when the Java run-time system detects that the Java heap is almost full. Every object has a bitmap in JVM. The bitmap is set for each object to track whether it's been used or not. When the bitmap is turned to 0, GC will take care of this object.