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

Vladimir Kozlov kvn at openjdk.org
Thu Jan 15 00:36:03 UTC 2026


On Wed, 14 Jan 2026 23:00:29 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

>> I am referencing `need_data()` in `compileBroker.cpp` code which set CTD:
>> 
>>   if (TrainingData::need_data() && !CDSConfig::is_dumping_final_static_archive()) {
>>     CompileTrainingData* ctd = CompileTrainingData::make(task);
>>     if (ctd != nullptr) {
>>       task->set_training_data(ctd);
>> 
>> 
>> I see we check CTD in places where we call `MethodTrainingData::make()`. That is why I assumed that it is called only during training run.
>
> 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()`.

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

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


More information about the hotspot-dev mailing list