RFR: 8362566: Use -Xlog:aot+map to print contents of existing AOT cache [v7]

Vladimir Kozlov kvn at openjdk.org
Fri Aug 22 15:23:53 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

Good.

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

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26514#pullrequestreview-3144919886


More information about the hotspot-dev mailing list