RFR: 8373114: Redundant MethodCounters in the preimage generated by training run [v3]

Ashutosh Mehra asmehra at openjdk.org
Thu Jan 15 15:25:47 UTC 2026


On Thu, 15 Jan 2026 00:32:31 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> The main user of the cached lookups is `MethodTrainingData* mtd = MethodTrainingData::find_fast(mh);` in `compilationPolicy.cpp:1024`. It's going to be called on every tiered event if `have_data() == true`. That's likely the main source of the MC pollution he's trying to avoid.
>
> Thank you, that is what I missed. `find()` and find_fast()` call `make()`.

> But I have a question though. Why do we treat the presence of the cache MTD value in MC as a proof that MTD refers to a MC?

That's a valid point. Ideally we should do the alternate approach mentioned [here](https://github.com/openjdk/jdk/pull/28670#issuecomment-3629940217). But the CDS code has limitations in implementing it (see [comment](https://github.com/openjdk/jdk/pull/28670#issuecomment-3640384909)). The current approach is more of a workaround. If this is not acceptable, we can wait until we modify the CDS code to remember follow-mode for each reference rather than the referenced object. @veresov what do you suggest?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28670#discussion_r2694826816


More information about the hotspot-dev mailing list