Integrated: 8362566: Use -Xlog:aot+map to print contents of existing AOT cache

Ioi Lam iklam at openjdk.org
Wed Aug 27 04:29:58 UTC 2025


On Mon, 28 Jul 2025 16:56:32 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.

This pull request has now been integrated.

Changeset: aaff9dec
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/aaff9dec241e4d8eebefd6beaf287582621f315c
Stats:     1767 lines in 14 files changed: 1304 ins; 454 del; 9 mod

8362566: Use -Xlog:aot+map to print contents of existing AOT cache

Reviewed-by: vlivanov, kvn

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

PR: https://git.openjdk.org/jdk/pull/26514


More information about the hotspot-dev mailing list