[External] : Re: Tool to peek into CDS archive

calvin.cheung at oracle.com calvin.cheung at oracle.com
Wed Jul 27 23:15:01 UTC 2022


On 7/27/22 2:25 PM, Ashutosh Mehra wrote:
> Hi Calvin,
>
> Thanks for the option. "-XX:+PrintSharedArchiveAndExit" is what I was 
> looking for.
> btw it looks like the PrintSharedDictionary flag is redundant, I guess 
> PrintSharedArchiveAndExit already covers it.
> I don't see PrintSharedDictionary being checked anywhere in the code base.

You're correct. I only see the flag declared in globals.hpp.

./share/runtime/globals.hpp:  product(bool, PrintSharedDictionary, 
false,                               \

In 8u, one needs to specify -XX:+PrintSharedDictionary in order to 
display the class names in a CDS archive. I haven't looked into since 
which release the processing of the flag was removed.

Anyway, I've file https://bugs.openjdk.org/browse/JDK-8291443 to clean 
it up.

thanks,
Calvin


>
> Regards,
> Ashutosh Mehra
>
>
> On Wed, Jul 27, 2022 at 5:02 PM <calvin.cheung at oracle.com> wrote:
>
>     Hi Ashutosh,
>
>     You can list the contents of the classes.jsa by doing:
>
>     java -XX:+PrintSharedArchiveAndExit -XX:+PrintSharedDictionary
>
>     If you have your own CDS archive, you can specify it using the
>     -XX:SharedArchiveFile option as follows:
>
>     java -XX:+PrintSharedArchiveAndExit -XX:+PrintSharedDictionary
>     -XX:SharedArchiveFile=<CDS archive>
>
>     Calvin
>
>
>     On 7/27/22 10:48 AM, Ashutosh Mehra wrote:
>     > Hi,
>     > I am wondering if there is any way to peek into the CDS archive and
>     > look into its contents. I believe a tool that dumps the list of
>     > classes in the archive would be really helpful.
>     >
>     > Regards,
>     > Ashutosh Mehra
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20220727/3f45b054/attachment.htm>


More information about the hotspot-dev mailing list