Demystifying Garbage Collection in Java
This talk is meant to demystify how garbage collection (GC) works in a Java runtime. The beginning of the talk will be focused on what GC is, discuss truths and myths, and how it is useful for the lifetime of a program. After laying out the basics I’ll explain how each GC algorithm work and how they can be implemented in a real world JVM (e.g. OpenJ9, Hotspot). How are these algorithms put together to make up a good GC configuration, and how one can better select a configuration/policy for their application? These are some of the questions that I will be addressing during this talk. I will do so by tying these algorithms to OpenJ9 GC policies and compare them to other policies such as G1, ZGC and Shenandoah. Different programs have different behaviours; by using the more appropriate policy for your application, it can improve its performance considerably. Lastly, I will conclude the talk by mentioning one advanced feature of OpenJ9 GC called double mapping arraylets, which is a way to improve memory management of large arrays in region based GCs. By the end of the talk you will have a better understanding on how the JVM manages its memory and be able to choose the more appropriate GC policy for your application. The talk is target for anyone who’s interested in JVMs (not advanced knowledge required).