`TenuredGeneration::update_gc_stats` records #promoted bytes after gc. The promoted-bytes metric is updated only after young-gc though.
This can lead to outdated promoted-bytes after a full-gcs. `TenuredGeneration::promotion_attempt_is_safe` use this metric to decide whether to start young-gc or full-gc, so this outdated promoted-bytes can result into choosing full-gc all the time if old-gen free-space is tight.
Therefore, the promoted-byte metric should be updated both after young-gc and after full-gc so that after some full-gc that reduces used-heap, one can get back to running young-gc.
This can lead to outdated promoted-bytes after a full-gcs. `TenuredGeneration::promotion_attempt_is_safe` use this metric to decide whether to start young-gc or full-gc, so this outdated promoted-bytes can result into choosing full-gc all the time if old-gen free-space is tight.
Therefore, the promoted-byte metric should be updated both after young-gc and after full-gc so that after some full-gc that reduces used-heap, one can get back to running young-gc.
- duplicates
-
JDK-8331684 Serial: Refactor SerialHeap::update_gc_stats and TenuredGeneration::update_gc_stats
-
- Closed
-