Adaptive Threading: The Goldilocks Dilemma with GC Parallelism
Presented by Salman Rana (IBM) at EclipseCon 2022.
This session is intended to take a deep dive into Eclipse OpenJ9 GC internals and performance. It first lays out the basics of GC and builds upon them to explore GC performance. The presentation will heavily focus on GC parallelism and Adaptive Threading, a new innovative GC optimization for self-tuning parallelism to minimize GC pause times. The role of parallelism in reducing GC pause times and the way in which GC tasks are parallelized to take advantage of available resources are explored. The audience will see the effects of GC parallelism on application performance and observe how parallelism can be unexpectedly detrimental to performance. This is followed by a discussion on sub-optimal parallelism vs. detrimental parallelism. The session then shifts focus onto Adaptive Threading and signifies the need to develop an optimization for self-tuning GC threading/parallelism. We explore how Adaptive Threading aims to find the “goldilocks” or equilibrium number of threads, where GC achieves peak performance through parallelism. With the use of heuristics and a threading model, an optimal thread count can be projected, and the thread count can be adjusted dynamically between GC cycles to minimize inefficient use of threads. The presentation showcases how this cannot be done trivially; accurate decisions must be made to determine when to adjust the thread count, and how much to adjust by.
This session starts with a brief overview of GC to clear up common misconceptions and demystify automatic memory management. It explores OpenJ9 GC technology to reveal how GC’s job of “reclaiming memory” can be implemented in various ways ranging in complexity and resulting in varying performance characteristics; from a single, simple, Stop-The-World collector to multiple collectors working together to form a complex pause-less generational policy. The use cases resulting in such complexity and the challenges associated with it are also presented, and implementation details, such as algorithms and mechanisms are highlighted.
This presentation is best suited for an audience that has a basic understanding of memory management, one that is somewhat familiar with GC tuning (e.g., heap sizing, aware of different JVM GC policies, exposed to common command line options, aware of performance metrics etc.). Through this session, the audience will get an under-the-hood look at OpenJ9 GC technology and its implementation, they will be exposed to innovations in the VM/GC space, and overall gain a better understanding of the implications of GC on application performance.