Why Java Provides Garbage Collector ?

In Java, there are no pointers. Memory management and allocation is done by JVM. Since memory allocation is automated, after some time JVM may go low on memory. At that time, JVM has to free memory from unused objects. To help with the process of reclaiming memory, Java provides an automated process called Garbage Collector.



You May Interest

What is a Singleton Class in Java ?

What are the Different States of a Thread in Java ?

What is the Lifecycle Stages of JSP ?

Enumeration and Iterator, Which One Has Better Performance in Jav ...

What is the Difference Between Abstract Class and Interface in Ja ...