Last week I delivered a very interesting session on modern garbage collection. Usually, I only get the opportunity to talk about GC in very specific contexts, such as .NET internals or performance optimization. This time, I was invited to give a talk on garbage collection theory and its practical applications in modern managed languages – which made for super-interesting preparation!
In the course of preparing for the talk I brought myself up to speed with the recent development in JVM garbage collectors as well as approaches taken by other managed languages such as Ruby and Python. Although there are considerable similarities (e.g., almost all managed languages use tracing generational garbage collection), there are also interesting differences in terms of the performance tuning, algorithm variety, and application interference between various languages and frameworks. There is also a wide body of research that is still expanding with novel approaches as well as performance tuning of existing algorithms. When you think about it, it’s pretty incredible that the fundamental ideas date back to the 1960’s, and in fact many people I meet still think of modern garbage collectors as the mark-and-copy garbage collector first implemented in Lisp circa 1963.
The slides from the talk are below – they are quite detailed, and there is a list of references on the last slide which you might find useful if anything piques your interest. The areas I find particularly exciting are concurrent compaction, which is still an unachieved goal for most mainstream garbage collectors (with Azul’s C4 being the notable exception), and parallelizing the garbage collection process, which is still not linear even with the most sophisticated approaches.