RFR: 8328278: Serial: Compute tenuring threshold before GC
Guoxiong Li
gli at openjdk.org
Tue Mar 19 02:34:22 UTC 2024
On Mon, 18 Mar 2024 16:57:46 GMT, Guoxiong Li <gli 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.
@ysramakrishna Previously, I thought the second point is right. So I said `It causes the method AgeTable::print_on prints the wrong tenuring threshold` in my issue description.
> That's OK, because the threshold 12 is the new threshold computed based on the age table stats presented in the table, corresponding to the demographics recorded in this collection. The new tenuring threshold will be used in the next collection.
But now, you and @albertnetymk said the first one is also acceptable and may be better. So currently, the main problem is not that `AgeTable::print_on prints the wrong tenuring threshold`. The problem becomes: **G1 and Serial have inconsistent behaviour**. The G1 prints the old threshold and the Serial GC prints the new threshold. Such inconsistence is obvious when reading the code. So what we should do now is decide which behaviour is right and unify the behaviour of these two GCs.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18329#issuecomment-2005637702
More information about the hotspot-gc-dev
mailing list