Throughput Analysis of Safepoint-attached Barriers in a Low-latency Garbage Collector : Analysis of a Compiler Optimization in the HotSpot JVM
Abstract: When using managed programming languages, there is an essential benefit in having a fast and efficient compiler and garbage collector; one garbage collector currently under development is the HotSpot low-latency concurrent Generational Z Garbage Collector. Concurrent memory management runs application threads and garbage collection threads simultaneously. This might result in pointers referencing the wrong memory field as the application and the garbage collector rearrange the heap at the same time. To address this problem, the Generational Z Garbage Collector uses barriers for each store and load operation that check, and if necessary restore pointer integrity. However, these barriers introduce an overhead, but are ideally only needed if the heap has been rearranged. Therefore, an optimization called safepoint-attached barriers has been suggested to reduce the number of barriers by removing barriers from pointers whose integrity can be assured. However, preliminary evaluation of the safepoint-attached barriers optimization has, contrary to expectation, not shown any significant improvement in throughput. This thesis conducts a thorough analysis of the safepoint-attached barriers optimization, with a focus on throughput. In addition, it suggests improvements to the optimization based on the result of the analysis. The analysis is conducted with industry-standard benchmarks, microbenchmarks, instrumentation, and source-code analysis. This study concludes that safepoint-attached barriers produces a small throughput benefit for the generational Z garbage collector, with a further increase in throughput limited by the optimization’s ability to remove barriers. This limitation depends on the compiler’s inline limit, the Java language’s use of virtual methods, and limited barrier elision inside standard loops. These limitations result in few barriers removed in repeated code segments. To address these issues, preliminary experiments on extended and improved inlining were performed, suggesting that improvements to safepoint-attached barriers could make the optimization more viable.
AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)