RFR: 8373114: Redundant MethodCounters in the preimage generated by training run [v3]
Ashutosh Mehra
asmehra at openjdk.org
Tue Dec 9 15:52:26 UTC 2025
On Tue, 9 Dec 2025 02:39:41 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:
>> Details are mentioned in the bug report and this mail thread https://mail.openjdk.org/pipermail/leyden-dev/2025-December/002843.html
>> After this patch the number of MethodCounters in the preimage are much less than before this patch. Also the number of MethodCounters in the preimage is the same as in the final AOTCache (these numbers are obtained using -Xlog:aot=trace).
>>
>> Before this patch for the training run:
>>
>> [18.610s][debug ][aot ] ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %
>> [18.610s][debug ][aot ] MethodCounters : 0 0 0.0 | 22471 1438144 6.2 | 22471 1438144 2.6
>>
>> Before this patch for the assembly phase:
>>
>> [6.680s][debug][aot ] ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %
>> [6.680s][debug][aot ] MethodCounters : 0 0 0.0 | 8588 549632 2.5 | 8588 549632 1.0
>>
>>
>> After this patch for the training run:
>>
>> [49.371s][debug ][aot ] ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %
>> [49.371s][debug ][aot ] MethodTrainingData : 0 0 0.0 | 4658 521696 2.1 | 4658 521696 0.9
>>
>>
>> After this patch for the assembly phase:
>>
>> [12.580s][debug][aot ] ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %
>> [12.580s][debug][aot ] MethodTrainingData : 0 0 0.0 | 4658 521696 2.1 | 4658 521696 0.9
>
> Ashutosh Mehra has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove blank line
>
> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
Before the patch with mainline:
In pre-image:
[19.021s][debug ][aot ] ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %
[19.021s][debug ][aot ] MethodCounters : 0 0 0.0 | 22485 1439040 6.2 | 22485 1439040 2.6
[19.021s][debug ][aot ] MethodTrainingData : 0 0 0.0 | 4998 519792 2.2 | 4998 519792 0.9
In final AOTCache:
[6.655s][debug][aot ] ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %
[6.655s][debug][aot ] MethodCounters : 0 0 0.0 | 8535 546240 2.5 | 8535 546240 1.0
[6.655s][debug][aot ] MethodTrainingData : 0 0 0.0 | 4998 519792 2.3 | 4998 519792 1.0
After the new fix, I see following stats:
In pre-image:
[12.397s][debug ][aot ] ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %
[12.397s][debug ][aot ] MethodCounters : 0 0 0.0 | 5440 348160 1.6 | 5440 348160 0.6
[12.397s][debug ][aot ] MethodTrainingData : 0 0 0.0 | 4985 518440 2.3 | 4985 518440 1.0
In final AOTCache:
[7.452s][debug][aot ] ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %
[7.452s][debug][aot ] MethodCounters : 0 0 0.0 | 4942 316288 1.4 | 4942 316288 0.6
[7.452s][debug][aot ] MethodTrainingData : 0 0 0.0 | 4985 518440 2.3 | 4985 518440 1.0
So the size of MethodCounters is 2.6% (before fix) vs 0.6% (after fix) in the preimage, and 1% (before fix) vs 0.6% (after fix) in the AOTCache.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28670#issuecomment-3632961425
More information about the hotspot-dev
mailing list