RFR: 8328278: Serial: Compute tenuring threshold before GC
Guoxiong Li
gli at openjdk.org
Mon Mar 18 17:00:26 UTC 2024
On Mon, 18 Mar 2024 16:37:28 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> 1. the printed threshold and age-table are directly related -- the threshold is calculated from the age-table.
> 2. the printed threshold and age-table are corresponding to the just finished gc-pause (since printing is at the end of gc-pause). IOW, threshold is used during scavenging and age-table is populated during scavenging.
>
> I think what you have in mind is 2 (right?), and that is what G1 does.
Yes, I think the second one is right.
If we use the first one, please consider such condition:
- The threshold used by GC is 13, so the first 14 rows of the age table has non-zero values.
- Assume the new threshold is computed to 12.
- Then the message we print, `Age table with threshold 12`, is strange, because the age table we then print has 14 rows of non-zero values.
If you still think the second one is better. The `Age table with threshold %u (max threshold %u)` may be revised to a clearer message. And the G1 could be adjusted too.
```C++
void AgeTable::print_on(outputStream* st, uint tenuring_threshold) {
st->print_cr("Age table with threshold %u (max threshold %u)",
tenuring_threshold, MaxTenuringThreshold);
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18329#issuecomment-2004454267
More information about the hotspot-gc-dev
mailing list