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 the Difference Between Throw and Throws in Java ?

How Can We Analyze the Dependencies in Java Classes and Packages ...

How Will You Make an Object Immutable in Java ?

Why Does Java Provide Default Constructor ?

What are the Thread-safe Classes in Java Collections Framework ?