The author presents a thought-provoking dilemma regarding the effectiveness of generational garbage collection in comparison to whole-heap collectors. While conventional wisdom suggests generational collectors should outperform their counterparts due to reduced tracing and copying work, the author’s benchmarks reveal unexpected results. Surprisingly, generational collectors sometimes exhibit longer collection times, challenging the notion that bump-pointer allocation is the key advantage. The author grapples with various factors impacting collection efficiency, including nursery size, write barriers, collection frequency, and benchmark applicability. Despite uncertainties, the author remains open to feedback and further exploration of generational garbage collection.
https://wingolog.org/archives/2025/02/09/baffled-by-generational-garbage-collection