RFR: 8353225: Add a way to iterate Klass inside the loaded CDS archive
Coleen Phillimore
coleenp at openjdk.org
Thu Apr 3 12:55:52 UTC 2025
On Wed, 2 Apr 2025 15:46:16 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>>> About the "may never be loaded": That is fine. I rather unnecessarily calculate the KLUT token for a class that will never be used than to pay for "Is this entry initialized?" branch in every use of the KLUT table. The latter is worse, performance-wise.
>>
>> Plus, the token is stored in the Klass, so it will have been calculated at dumptime, and so the only thing missing is copying the entry to its table position at runtime.
>
> There's only a small number of classes that have allocated instances in the CDS archive. I think it's better to build a table of these classes and create KLUT information for them.
>
> BTW, none of the classes in the `LambdaProxyClassDictionary` have allocated instances.
>
>
> $ LOG=-Xlog:cds+map=trace,cds+map+oops=trace:file=cds.oops.txt:none:filesize=0
> $ java -Xshare:dump $LOG
> $ grep '@@ Object' cds.oops.txt | cut -b 44- | sed -e 's/ .*//g' | sort | uniq | wc
> 79 79 2456
> $ java -Xshare:dump $LOG -XX:+AOTClassLinking
> $ grep '@@ Object' cds.oops.txt | cut -b 44- | sed -e 's/ .*//g' | sort | uniq | wc
> 172 172 6068
I wonder if you could generate the KLUT information when objects are allocated rather than eagerly when classes are loaded.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24311#discussion_r2026933676
More information about the hotspot-runtime-dev
mailing list