skip to main content
10.1145/3265723.3265735acmconferencesArticle/Chapter ViewAbstractPublication PagesapsysConference Proceedingsconference-collections
research-article

Analysis and Optimizations of Java Full Garbage Collection

Authors Info & Claims
Published:27 August 2018Publication History

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).

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. Google. 2018. Chrome V8. https://developers.google.com/v8/.Google ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. OpenJDK. 2018. JEP 307: Parallel Full GC for G1. http://openjdk.java.net/jeps/307.Google ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. Jeffrey Richter. 2006. CLR via c#. Vol. 4. Microsoft Press Redmond.Google ScholarGoogle Scholar
  13. SNAP. 2014. Friendster. http://snap.stanford.edu/data/com-Friendster.html.Google ScholarGoogle Scholar
  14. SPEC. 2008. SPECjvm2008. https://www.spec.org/jvm2008/.Google ScholarGoogle Scholar
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. David Ungar. 1984. Generation scavenging: A non-disruptive high performance storage reclamation algorithm. In ACM Sigplan notices, Vol. 19. ACM, 157--167. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. Paul C Zikopolous, George Baklarz, and Dan Scott. 2005. Apache derby/IBM cloudscape. Prentice Hall PTR. Google ScholarGoogle ScholarDigital LibraryDigital Library
  1. Analysis and Optimizations of Java Full Garbage Collection

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      APSys '18: Proceedings of the 9th Asia-Pacific Workshop on Systems
      August 2018
      150 pages
      ISBN:9781450360067
      DOI:10.1145/3265723

      Copyright © 2018 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 27 August 2018

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed limited

      Acceptance Rates

      APSys '18 Paper Acceptance Rate18of48submissions,38%Overall Acceptance Rate149of386submissions,39%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader