About Garbage Collection

- 1 min

About Garbage Collection

What is automatic garbage collection ?

Automatic garbage collection is the process of looking at heap memory, identifying which objects are in use and which are not, and deleting the unused object. An unused objet can be relcaimed

In a programming language like C, allocating and deallocating memory is a manual process. In Java, process of deallocating memory is handled automatically by the garbage collector. The basic process cab be described as follows.

Step

Step 1 marking.

This is where the garbage collector identifies which pieces of memory are in use and which are not.

Step 2 Normal deletion.

Step 2a Deleting with compacting.

JVM generations.

Stop the world event : this means that all application threads are stopped until the operation completes.

Reference

comments powered by Disqus
rss facebook twitter github gitlab youtube mail spotify lastfm instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora quora