DevEX - reference for building teams, processes, and platforms
Garbage collection in java
1. Garbage collection
● Garbage collection is the process of looking at heap
memory, identifying which objects are in use and
which are not, and deleting the unused objects.
● An in use object, or a referenced object, means that
some part of your program still maintains a pointer to
that object.
● An unused object, or unreferenced object, is no
longer referenced by any part of your program.
2. Steps involved in garbage collection
● Marking
● Normal deletion
● Deletion with compaction
3. Generational garbage collection
Types of generational garbage collection
● young generation objects
● Old generation objects
● Permanent generation objects
4. Steps involved in Generational
garbage collection
● Object allocation
● Filling the Eden space
● Copying reference object
● Object aging
● Additional aging
● promotion