Resumen
The Java garbage collector is one of the important modules of the Java Virtual Machine (JVM). When an object has no references, it is considered "garbage". The memory space occupied by this object needs to be freed. The role of the Java garbage collector is to manage memory and release the memory occupied by this "garbage". This article introduces the main function and working principle of the Java garbage collector, focusing on three mainstream garbage collection algorithms and compares serial, parallel, and concurrent design choices. This article also introduces 7 garbage collectors in Java based on different algorithms and design choices: Serial, Serial Old, ParNew, Parallel, Scavenge, Parallel Old, CMS, and G1.