ABSTRACT
Java runtime frees applications from manual memory management by its automatic garbage collection (GC), at the cost of stop-the-world pauses. State-of-the-art collectors leverage multiple generations, which will inevitably suffer from a full GC phase scanning the whole heap and induce a pause tens of times longer than normal collections, which largely affects both throughput and latency of the entire system. In this paper, we analyze the full GC performance of HotSpot Parallel Scavenge garbage collector comprehensively and study its algorithm design in depth. We find out that heavy dependencies among heap regions cause poor thread utilization. Furthermore, many heap regions contain mostly live objects (referred to as dense regions), which are unnecessary to collect. To solve these problems, we introduce two kinds of optimizations: allocating shadow regions dynamically as compaction destination to eliminate region dependencies and skipping dense regions to reduce GC workload. Evaluation results show the optimizations lead to averagely 2.6X (up to 4.5X) improvement in full GC throughput and thereby boost the application performance by 18.2% on average (58.4% at best).
- Stephen M Blackburn, Robin Garner, Chris Hoffmann, Asjad M Khang, Kathryn S McKinley, Rotem Bentzur, Amer Diwan, Daniel Feinberg, Daniel Frampton, Samuel Z Guyer, et al. 2006. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of the 21th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, October 22-26, 2006, USA. ACM, 169--190. Google ScholarDigital Library
- Rodrigo Bruno and Paulo Ferreira. 2017. POLM2: automatic profiling for object lifetime-aware memory management for hotspot big data applications. In Proceedings of the 18th ACM/IFIP/USENIX Middleware Conference. ACM, 147--160. Google ScholarDigital Library
- Rodrigo Bruno, Luís Picciochi Oliveira, and Paulo Ferreira. 2017. NG2C: pretenuring garbage collection with dynamic generations for HotSpot big data applications. In Proceedings of the 2017 ACM SIGPLAN International Symposium on Memory Management. ACM, 2--13. Google ScholarDigital Library
- Brendon Cahoon and Kathryn S McKinley. 2001. Data flow analysis for software prefetching linked data structures in Java. In Parallel Architectures and Compilation Techniques, 2001. Proceedings. 2001 International Conference on. IEEE, 280--291. Google ScholarDigital Library
- David Detlefs, Christine Flood, Steve Heller, and Tony Printezis. 2004. Garbage-first garbage collection. In Proceedings of the 4th international symposium on Memory management. ACM, 37--48. Google ScholarDigital Library
- Lokesh Gidra, Gaël Thomas, Julien Sopena, and Marc Shapiro. 2013. A study of the scalability of stop-the-world garbage collectors on multicores. In Proceedings of the eighteenth international conference on Architectural support for programming languages and operating systems. ACM, 229--240. Google ScholarDigital Library
- Lokesh Gidra, Gaël Thomas, Julien Sopena, Marc Shapiro, and Nhan Nguyen. 2015. NumaGiC: a Garbage Collector for Big Data on Big NUMA Machines. In Proceedings of the 20th International Conference on Architectural Support for Programming Languages and Operating Systems. ACM, 661--673. Google ScholarDigital Library
- Google. 2018. Chrome V8. https://developers.google.com/v8/.Google Scholar
- Khanh Nguyen, Lu Fang, Guoqing Xu, Brian Demsky, Shan Lu, Sanazsadat Alamian, and Onur Mutlu. 2016. Yak: A high-performance big-data-friendly garbage collector. In Proc. the 12th USENIX Conference on Operating Systems Design and Implementation. Google ScholarDigital Library
- OpenJDK. 2018. JEP 307: Parallel Full GC for G1. http://openjdk.java.net/jeps/307.Google Scholar
- Erik Österlund and Welf Löwe. 2016. Block-free concurrent GC: stack scanning and copying. In Proceedings of the 2016 ACM SIGPLAN International Symposium on Memory Management. ACM, 1--12. Google ScholarDigital Library
- Jeffrey Richter. 2006. CLR via c#. Vol. 4. Microsoft Press Redmond.Google Scholar
- SNAP. 2014. Friendster. http://snap.stanford.edu/data/com-Friendster.html.Google Scholar
- SPEC. 2008. SPECjvm2008. https://www.spec.org/jvm2008/.Google Scholar
- Kun Suo, Jia Rao, Hong Jiang, and Witawas Srisa-an. 2018. Characterizing and optimizing hotspot parallel garbage collection on multicore systems. In Proceedings of the Thirteenth EuroSys Conference. ACM, 35:1--35:15. Google ScholarDigital Library
- Gil Tene, Balaji Iyengar, and Michael Wolf. 2011. C4: The continuously concurrent compacting collector. In Proceedings of the 10th international symposium on Memory management. ACM, 79--88. Google ScholarDigital Library
- David Ungar. 1984. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In ACM Sigplan notices, Vol. 19. ACM, 157--167. Google ScholarDigital Library
- Yang Yu, Tianyang Lei, Weihua Zhang, Haibo Chen, and Binyu Zang. 2016. Performance Analysis and Optimization of Full Garbage Collection in Memory-hungry Environments. In Proceedings of the 12th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments. ACM, 123--130. Google ScholarDigital Library
- Matei Zaharia, Mosharaf Chowdhury, Michael J Franklin, Scott Shenker, and Ion Stoica. 2010. Spark: cluster computing with working sets. In Proceedings of the 2nd USENIX conference on Hot topics in cloud computing. Google ScholarDigital Library
- Paul C Zikopolous, George Baklarz, and Dan Scott. 2005. Apache derby/IBM cloudscape. Prentice Hall PTR. Google ScholarDigital Library
- Analysis and Optimizations of Java Full Garbage Collection
Recommendations
ScissorGC: scalable and efficient compaction for Java full garbage collection
VEE 2019: Proceedings of the 15th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution EnvironmentsJava runtime frees applications from manual memory management through automatic garbage collection (GC). This, however, is usually at the cost of stop-the-world pauses. State-of-the-art collectors leverage multiple generations, which will inevitably ...
A generational on-the-fly garbage collector for Java
PLDI '00: Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementationAn on-the-fly garbage collector does not stop the program threads to perform the collection. Instead, the collector executes in a separate thread (or process) in parallel to the program. On-the-fly collectors are useful for multi-threaded applications ...
Controlling garbage collection and heap growth to reduce the execution time of Java applications
In systems that support garbage collection, a tension exists between collecting garbage too frequently and not collecting it frequently enough. Garbage collection that occurs too frequently may introduce unnecessary overheads at the risk of not ...
Comments