Garbage collector is the name of the part of the JVM that handles the memory. To make it very simple, it is the part releasing the memory held by some unused objects and reallocating this memory space to new objects.
This part is dependent on the JVM you are using, but all the algorithms use the same sort of logic. So, it is important to understand how it works in the high level, and then you can investigate the specifics of your particular JVM.
In the context of this book, we will limit ourselves to the HotSpot JVM (the Oracle one).
The heap memory is divided into two main spaces: the young generation and the old one. The young generation is itself divided into multiple spaces: the Eden and the survivors (there are two ...