Great explanation how the default garbage collectors work. Garbage collection (or GC) is an automated way to reclaim for reuse memory that is no longer in use. By Christine H. Flood.
Unlike other languages in which objects are allocated and destroyed manually, with GC, Java programmers don’t need to pick up and examine each object to decide whether it is needed. Instead, the omniscient GC housekeeper process works behind the scenes quietly discarding objects that are no longer useful and tidying up what’s left. This decluttering leads to an efficient program.
The article does a great job explaining:
- What is garbage collection?
- Parallel garbage collector
- Garbage-first garbage collector
- Shenandoah garbage collector
Also note that since this article was first published, GC in the JDK has evolved in new ways. Nice work!
[Read More]