Status of AppCDS

August Nagro augustnagro at gmail.com
Tue Oct 3 21:35:29 UTC 2017


Ah, my assumption was that the archive would be created by default by the
installer.

On Tue, Oct 3, 2017 at 4:07 PM David Holmes <david.holmes at oracle.com> wrote:

> On 4/10/2017 6:16 AM, August Nagro wrote:
> >  > you have to create the shared archive if not using a JRE installer.
> >
> > I've tried `java -Xshare:dump` on a Windows and Mac machine with JRE 9
> > installed with the oracle installer. In both cases I had to run the
> > following to generate the archive:
> > ```
> > sudo touch /lib/[arch]/server/classes.jsa
> > sudo chmod 777 /lib/[arch]/server/classes.jsa
> > java -Xshare:dump
> > ```
>
> Of course you have to have permission to write the shared archive into
> the default location. That's why you would normally do this as part of
> deloying the JRE on your machine (eg as part of the installer process on
> Windows).
>
> There is also an option to specify a different archive location using
> -XX:+UnlockDiagnosticVMoptions -XX:SharedArchiveFile=xxx
>
> David
> -----
>
> >  > Not sure it is still considered "experimental" but it is still
> evolving.
> > It is a commercial feature in Java 9 but will not be in the future:
> >
> > That's great; I was just going off the docs for `-XX:+UseAppCDS` on the
> > man page for java.
> >
> >  > *CDS has been constantly improved over the last few releases
> > andcontinues to be improved for the next versions of the platform.
> >
> > Good to here!
> >
> > Thanks,
> >
> > - August
> >
> > On Mon, Oct 2, 2017 at 9:30 PM David Holmes <david.holmes at oracle.com
> > <mailto:david.holmes at oracle.com>> wrote:
> >
> >     Moving to hotspot-runtime-dev and bcc'ing the discuss list.
> >
> >     Hello Augusto,
> >
> >     On 3/10/2017 7:25 AM, August Nagro wrote:
> >      > Hello,
> >      >
> >      > Both Class Data Sharing (CDS) [1] and AppCDS [2] are very
> >     interesting but
> >      > seemingly neglected features of the Java Platform, offering the
> >     ability to
> >      > reduce startup time.
> >
> >     AppCDS is under continual development and is not "neglected" at all.
> >
> >      > Class Data Sharing is the global cache stored in
> >      > /lib/[arch]/server/classes.jsa, and circumvents long
> >     class-loading times by
> >      > caching the JVM’s internal representation of system jars and
> >     memory-mapping
> >      > them in during startup. The feature's documentation [1] has been
> >     updated
> >      > for Java 9, but I have yet to see a JDK or JRE installation that
> >     can use it
> >      > without manually generating the archive. In every case I've
> >     encountered,
> >      > the file needs to first be created (and given appropriate access
> >      > permissions) with admin access, and then generated by `java
> >     -Xshare:dump`.
> >
> >     Yes you have to create the shared archive if not using a JRE
> installer.
> >     But that can be done by whomever deploys the JRE in your
> environment. My
> >     understanding is that, due to the format of the archive, a given
> archive
> >     is only guaranteed to beusable on the machine on which it was
> created.
> >
> >      > AppCDS extends the same feature to user libraries. It works well,
> >     but has
> >      > been experimental since (before?) JDK 8 and is commercial.
> >
> >     Not sure it is still considered "experimental" but it is still
> evolving.
> >     It is a commercial feature in Java 9 but will not be in the future:
> >
> >
> http://mail.openjdk.java.net/pipermail/discuss/2017-September/004281.html
> >
> >      >
> >      > Java has been criticized for its slow startup times. Improvements
> >     would
> >      > enable command line utilities, the realistic use of JShell .jsh
> >     scripts
> >      > (currently takes >4 seconds for hello world on my Mac [3]), and
> other
> >      > applications. I'm not sure how *CDS concerts with other OpenJDK
> >     efforts
> >      > like AOT compilation, but it offers the advantage of architecture
> >      > independency and the ability to be shared across multiple JVMs.
> >
> >     An archive can be shared across multiple JVMs on the same machine.
> >
> >      > Is *CDS doomed for deprecation, or will it be improved? Without
> >     work to CDS
> >      > or changes to AppCDS, the current state is not very usable.
> >
> >     *CDS has been constantly improved over the last few releases and
> >     continues to be improved for the next versions of the platform.
> >
> >     Regards,
> >     David Holmes
> >
> >      > Regards,
> >      >
> >      > August Nagro
> >      >
> >      > [1]: https://docs.oracle.com/javase/9/vm/class-data-sharing.htm
> >      > [2]:
> >      >
> >
> http://docs.oracle.com/javase/9/tools/java.htm#JSWOR-GUID-31503FCE-93D0-4175-9B4F-F6A738B2F4C4
> >      >
> >      > [3]:
> >      > Executing command `jshell helloworld.jsh`, with file containing
> >      > ```
> >      > System.out.println("hello world");
> >      > /exit
> >      > ```
> >      >
> >
>


More information about the hotspot-runtime-dev mailing list