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 an EnumSet in Java ?

What is the Main Benefit of IOC Principle in Java ?

What are the Differences Between a List and Set Collection in Jav ...

How Can You Determine If Your Program Has a Deadlock in Java ?

Can We Use Thread.sleep Method For Real-time Processing in Java ?