- 요약
- G1 GC worst-case에서 향상 목적
- JDK9부터 기본 GC가 G1으로 변경되었는데, concurrent GC에서 full GC가 발생 할 수 있음.
- G1 GC의 알고리즘 mark-sweep-compact를 병렬로 수행하도록 변경되었으며 -XX:ParallelGCThreads 옵션을 사용해서 스레드 수 조정 가능
JEP 307: Parallel Full GC for G1
Owner | Stefan Johansson |
Type | Feature |
Scope | Implementation |
Status | Closed / Delivered |
Release | 10 |
Component | hotspot / gc |
Discussion | hotspot dash gc dash dev at openjdk dot java dot net |
Effort | M |
Duration | M |
Reviewed by | Mikael Vidstedt |
Endorsed by | Mikael Vidstedt |
Created | 2017/01/17 11:40 |
Updated | 2018/03/29 07:39 |
Issue | 8172890 |
Summary
Improve G1 worst-case latencies by making the full GC parallel.
Non-Goals
Match the performance of the parallel collector's full GC for all use cases.
Motivation
The G1 garbage collector was made the default in JDK 9. The previous default, the parallel collector, has a parallel full GC. To minimize the impact for users experiencing full GCs, the G1 full GC should be made parallel as well.
Description
The G1 garbage collector is designed to avoid full collections, but when the concurrent collections can't reclaim memory fast enough a fall back full GC will occur. The current implementation of the full GC for G1 uses a single threaded mark-sweep-compact algorithm. We intend to parallelize the mark-sweep-compact algorithm and use the same number of threads as the Young and Mixed collections do. The number of threads can be controlled by the -XX:ParallelGCThreads option, but this will also affect the number of threads used for Young and Mixed collections.
Testing
- Full GC time analysis to ensure that the full GC times have improved. Looking at benchmark scores will probably not be good enough since G1 is designed to avoid full GCs.
- Runtime analysis using VTune or Solaris Studio Performance Analyzer to find unnecessary bottlenecks.
Risks and Assumptions
- The work is based on the assumption that nothing in the fundamental design of G1 prevents a parallel full GC.
- The fact that G1 uses regions will most likely lead to more wasted space after a parallel full GC than for a single threaded one.
'JAVA > 트러블슈팅' 카테고리의 다른 글
alibaba의 arthas로 재시작없이 running 중인 어플리케이션의 logback 로그 레벨 변경하기 (0) | 2021.04.29 |
---|---|
AWS의 오류 재 시도 횟수 및 지수 백오프(or MSA에서 실패 재 시도) (0) | 2019.12.16 |
online thread dump analyzer (0) | 2019.08.20 |
Tomcat에서 SecureRandom 처리 문제로 시작이 느린 이슈 처리 (0) | 2018.10.02 |