RFR: 8332516: Serial: Refactor how promoted bytes are sampled

Ivan Walulya iwalulya at openjdk.org
Tue May 21 07:09:03 UTC 2024


On Mon, 20 May 2024 09:05:09 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Simple heuristic update around how promoted-bytes are tracked. The real change is in `TenuredGeneration::update_promote_stats`, which uses `used-old-gen` before/after gc to derived promoted-bytes.
> 
> The metric is imprecise in the cases of promotion-failure, because those should be rare. Also, after full-gc, used-old-gen an be decreased; in this case, we'd set promoted bytes as the min value (zero), the best-effort estimate.

Minor suggestion

src/hotspot/share/gc/serial/tenuredGeneration.cpp line 394:

> 392: void TenuredGeneration::update_promote_stats() {
> 393:   size_t used_after_gc = used();
> 394:   size_t promoted_in_bytes;

Suggestion:

  size_t promoted_in_bytes = 0;

and do away with the else case.

-------------

Marked as reviewed by iwalulya (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19306#pullrequestreview-2067716277
PR Review Comment: https://git.openjdk.org/jdk/pull/19306#discussion_r1607754116


More information about the hotspot-gc-dev mailing list