## Notes
- Uses threads; can be defined as a CLI flag
- This means it can be multi-threaded
- Limit maximum GC pause time
## Serial Garbage Collector
- Simplest
- Uses a single thread
- When GC is triggered, pauses all running application threads
- Used for small applications or embedded systems that are limited on memory
## Parallel Garbage Collector
- Default GC in Java 8
- Uses multiple threads
- Can tolerate some pauses, like batch processing systems
- Also pauses the application
## Concurrent Mark-Sweep GC
- Designed to minimize pauses caused by GC
- Works while the application is running
- Pauses when
- Parallel change in heap memory
- Marking referenced objects in old generation space
## G1
- Introduced in Java 7
- Default in Java 9
- Good for applications with large heap sizes
- Divides heap into equally sized regions
- Prioritizes regions with the most unused objects (G1 = garbage-first)
- Compacts free heap space after garbage collection; improves memory efficiency
## Z GC
- Low latency
- Introduced in Java 11
## Shenandoah GC
- Low pause time GC introduced in Java 12
- Runs while application runs
## References
- [Types of JVM Garbage Collectors - Geeks for Geeks](https://www.geeksforgeeks.org/java/types-of-jvm-garbage-collectors-in-java-with-implementation-details/)