Java GC Tutorials - Herong's Tutorial Examples - v1.11, by Dr. Herong Yang
Object References and Garbage Collection
This chapter provides tutorial notes and example codes on Object References and Garbage Collection. Topics include object reference types; strong reference test program; final reference test program; dead objects with final references in heap; performance impact of final references.
These sections are omitted from this Web preview version. To view the full content, see information on how to obtain the full version this book.
Object Reference Types
Strong Reference GC Test Program
Strong Reference Test with Serial GC
Final Reference GC Test Program
Final Reference Test with Serial GC
Performance Impact of Final References
Takeaways:
Table of Contents
Heap Memory Area and Size Control
JVM Garbage Collection Logging
Introduction of Garbage Collectors
Serial Collector - "+XX:+UseSerialGC"
Parallel Collector - "+XX:+UseParallelGC"
Concurrent Mark-Sweep (CMS) Collector - "+XX:+UseConcMarkSweepGC"
Garbage First (G1) Collector - "+XX:+UseG1GC"
The Z Garbage Collector (ZGC) - "+XX:+UseZGC"
►Object References and Garbage Collection
Garbage Collection Performance Test Program
Performance Tests on Serial Collector
Performance Tests on Parallel collector
Performance Tests on Concurrent collector
Performance Tests on G1 collector