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 are the Differences Between a HashSet and a HashMap in Java ...

How Multi-threading Works in Java ?

What is the Use of a Dictionary Class in Java ?

What is the Difference Between sendRedirect and forward in a JSP ...

What is the Difference Between a Nested Class and an Inner Class ...