Option (B)
Java garbage collection refers to the automatic process whereby the JVM scans and clears off objects not in use, hence leaving enough space without causing any memory leak. It gives no need to have managed memory, which makes coding simpler and reduces the possibility of errors. Algorithms of the JVM for searching and discarding unreachable objects include Mark and Sweep. It is divided into generations: Young and Old. Other collectors such as G1, Parallel, and ZGC handle GC quite differently depending on their objectives from performance. Even though GC is an automatic process, pauses may occur during its operation. Thus, developers may need to tweak its behavior to optimize application performance.