RFR: 8362566: Use -Xlog:aot+map to print contents of existing AOT cache [v7]
Vladimir Ivanov
vlivanov at openjdk.org
Tue Aug 26 17:25:37 UTC 2025
On Fri, 22 Aug 2025 04:09:28 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> Implement `-Xlog:aot+map` in the production run:
>>
>>
>> $ java -cp HelloWorld.jar -XX:AOTCache=HelloWorld.aot \
>> -Xlog:aot+map=file=aot.map:none:filesize=0 \
>> HelloWorld
>>
>>
>> I moved the old logging code from archiveBuilder.cpp into a new fille, aotMapLogger.cpp. I did the following to print the map in the production run:
>>
>> 1. When dumping the AOT cache, `ArchiveBuilder` maintains a list of all the metaspace objects in the archive. However, there's no such list when we are loading from the AOT cache. Therefore, I added a new `RuntimeGatherArchivedMetaspaceObjs` class to discover all the metaspace objects that are stored in the AOT cache.
>> 2. A significant rewrite is needed for printing the oops (see comments around `FakeOop`) because we only have an image of the oops in the AOT cache and these aren't real heap objects.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>
> Added comment about why -Xlog:aot+map,...,filesize=0 is needed
Looks good.
-------------
Marked as reviewed by vlivanov (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26514#pullrequestreview-3156618560
More information about the hotspot-dev
mailing list