<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi Charlie, </p>
    <p><br>
    </p>
    <p> </p>
    <blockquote type="cite">[] jdk25 $ rm
      /Users/headius/work/jruby/lib/jruby-java25.jsa<br>
      [] jdk25 $
      /Library/Java/JavaVirtualMachines/zulu-25.jdk/Contents/Home/bin/java
      @/Users/headius/work/jruby/bin/.jruby.java_opts
      @/Users/headius/work/jruby/bin/.jruby.module_opts -Xss2048k
      -Djffi.boot.library.path=/Users/headius/work/jruby/lib/jni
      -Djava.security.egd=<a class="moz-txt-link-freetext" href="file:/dev/urandom" moz-do-not-send="true">file:/dev/urandom</a>
      -XX:+AutoCreateSharedArchive
      -XX:SharedArchiveFile=/Users/headius/work/jruby/lib/jruby-java25.jsa
      --enable-native-access=org.jruby.dist
      --sun-misc-unsafe-memory-access=allow --module-path
      /Users/headius/work/jruby/lib/jruby.jar -classpath :
      -Djruby.home=/Users/headius/work/jruby
      -Djruby.lib=/Users/headius/work/jruby/lib -Djruby.script=jruby
      -Djruby.shell=/bin/sh org.jruby.Main -e 1</blockquote>
    <br>
    <p>The problem here is -XX:+AutoCreateSharedArchive is for creating
      a dynamic CDS archive, which runs on top of the static CDS archive
      that comes with the JDK.</p>
    <p>The archived module graph is created only for the static CDS
      archive (or JEP 483 AOT cache). It's not created for the dynamic
      CDS archive. This is because the archived module graph requires
      the archiving of Java heap objects, which is not supported by the
      dynamic archive.</p>
    <p>The errors you saw basically meant that because different
      parameters were given for --module-path, --enable-native-access,
      etc, than those used when we created the default CDS archive, we
      are not able to use the archived module graph.</p>
    <p>This is a performance regression from JDK 24, as the archived
      module graph would have also been disabled with JDK 24.</p>
    <p>However, in JDK 25, we changed the logging of these messages so
      they are now printed in the "error" channel. This is a bug. I have
      created <a class="moz-txt-link-freetext" href="https://bugs.openjdk.org/browse/JDK-8369079" moz-do-not-send="true">https://bugs.openjdk.org/browse/JDK-8369079</a>
      and will try to backport the fix to JDK 25u.</p>
    <p>Meanwhile, you can add -Xlog:cds=none to disable these logs.</p>
    <p>A better alternative would be to use the AOT cache. It will have
      faster start-up time, and it will store an archived module graph
      that matches your command-line settings.</p>
    <p><br>
    </p>
    <p>Thanks</p>
    <p>- Ioi</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 10/2/25 10:09 AM, Charles Oliver
      Nutter wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAE-f1xRvjuhHMizorF78Q_mGOYNsoesZ+KDWBh-cve_oOHqx-g@mail.gmail.com">
      <div dir="ltr">Full output as a gist: <a href="https://gist.github.com/headius/88d91118ef1487b4fbff357fecf06904" moz-do-not-send="true" class="moz-txt-link-freetext">https://gist.github.com/headius/88d91118ef1487b4fbff357fecf06904</a></div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">On Thu, Oct 2, 2025 at
          12:03 PM Charles Oliver Nutter <<a href="mailto:headius@headius.com" moz-do-not-send="true" class="moz-txt-link-freetext">headius@headius.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">Here's the full -Xlog:aot,cds output. Nothing
            jumps out at me. It seems to be confused about which modules
            are specified at dump time, even though the same command
            line sees those modules at runtime.
            <div><br>
            </div>
            <div>[0.010s][info][cds] trying to map
/Library/Java/JavaVirtualMachines/zulu-25.jdk/Contents/Home/lib/server/classes.jsa<br>
              [0.010s][info][cds] Opened shared archive file
/Library/Java/JavaVirtualMachines/zulu-25.jdk/Contents/Home/lib/server/classes.jsa.<br>
              [0.010s][info][cds] The shared archive file was created
              with UseCompressedOops = 1, UseCompressedClassPointers =
              1, UseCompactObjectHeaders = 0<br>
              [0.010s][info][cds] Core region alignment: 16384<br>
              [0.010s][info][cds] trying to map
              /Users/headius/work/jruby/lib/jruby-java25.jsa<br>
              [0.010s][info][cds] Opened shared archive file
              /Users/headius/work/jruby/lib/jruby-java25.jsa.<br>
              [0.010s][info][cds] The shared archive file was created
              with UseCompressedOops = 1, UseCompressedClassPointers =
              1, UseCompactObjectHeaders = 0<br>
              [0.010s][info][cds] optimized module handling: disabled
              because archive was created without optimized module
              handling<br>
              [0.010s][info][cds] ArchiveRelocationMode: 1<br>
              [0.010s][info][cds] ArchiveRelocationMode == 1: always map
              archive(s) at an alternative address<br>
              [0.010s][info][cds] Try to map archive(s) at an
              alternative address<br>
              [0.010s][info][cds] Reserved archive_space_rs
              [0x0000000f00000000 - 0x0000000f03000000] (50331648) bytes
              (includes protection zone)<br>
              [0.010s][info][cds] Reserved class_space_rs  
              [0x0000000f03000000 - 0x0000000f43000000] (1073741824)
              bytes<br>
              [0.010s][info][cds] Mapped static  region #0 at base
              0x0000000f00004000 top 0x0000000f004b0000 (ReadWrite)<br>
              [0.010s][info][cds] Mapped static  region #1 at base
              0x0000000f004b0000 top 0x0000000f00d94000 (ReadOnly)<br>
              [0.010s][info][cds] Mapped static  region #2 at base
              0x00000001009d8000 top 0x0000000100a0c000 (Bitmap)<br>
              [0.020s][error][cds] An error has occurred while
              processing the shared archive file. Run with -Xlog:aot,cds
              for details.<br>
              [0.020s][error][cds] optimized module handling: disabled
              because extra module path(s) are specified<br>
              [0.020s][info ][cds] archived module property
              jdk.module.main: (null)<br>
              [0.020s][info ][cds] archived module property
              jdk.module.addexports: (null)<br>
              [0.020s][info ][cds] archived module property
              jdk.module.addmods: (null)<br>
              [0.020s][info ][cds] archived module property
              jdk.module.enable.native.access: (null)<br>
              [0.020s][error][cds] Mismatched values for property
              jdk.module.enable.native.access: org.jruby.dist specified
              during runtime but not during dump time<br>
              [0.020s][error][cds] Disabling optimized module handling<br>
              [0.020s][info ][cds] archived module property
              jdk.module.addopens: (null)<br>
              [0.020s][error][cds] Mismatched values for property
              jdk.module.addopens: java.base/<a href="http://java.io" target="_blank" moz-do-not-send="true">java.io</a>=org.jruby.dist,java.base/java.nio.channels=org.jruby.dist,java.base/<a href="http://sun.nio.ch" target="_blank" moz-do-not-send="true">sun.nio.ch</a>=org.jruby.dist,java.management/sun.management=org.jruby.dist
              specified during runtime but not during dump time<br>
              [0.020s][error][cds] Disabling optimized module handling<br>
              [0.020s][info ][cds] archived module property
              jdk.module.addreads: (null)<br>
              [0.020s][info ][cds] optimized module handling: disabled<br>
              [0.020s][info ][cds] full module graph: disabled<br>
              [0.021s][info ][cds] Mapped dynamic region #0 at base
              0x0000000f00d94000 top 0x0000000f01a80000 (ReadWrite)<br>
              [0.021s][info ][cds] Mapped dynamic region #1 at base
              0x0000000f01a80000 top 0x0000000f02b4c000 (ReadOnly)<br>
              [0.021s][info ][cds] Mapped dynamic region #2 at base
              0x0000000101a8c000 top 0x0000000101afc000 (Bitmap)<br>
              [0.025s][info ][cds] CDS archive was created with max heap
              size = 128M, and the following configuration:<br>
              [0.025s][info ][cds]     narrow_klass_base at mapping
              start address, narrow_klass_pointer_bits = 32,
              narrow_klass_shift = 0<br>
              [0.025s][info ][cds]     narrow_oop_mode = 1,
              narrow_oop_base = 0x0000000000000000, narrow_oop_shift = 3<br>
              [0.025s][info ][cds] The current max heap size = 6144M,
              G1HeapRegion::GrainBytes = 4194304<br>
              [0.025s][info ][cds]     narrow_klass_base =
              0x0000000f00000000, arrow_klass_pointer_bits = 32,
              narrow_klass_shift = 0<br>
              [0.025s][info ][cds]     narrow_oop_mode = 1,
              narrow_oop_base = 0x0000000000000000, narrow_oop_shift = 3<br>
              [0.025s][info ][cds]     heap range = [0x0000000680000000
              - 0x0000000800000000]<br>
              [0.025s][info ][cds] Preferred address to map heap data
              (to avoid relocation) is 0x00000007ffe00000<br>
              [0.025s][info ][cds] Heap data mapped at
              0x00000007ffc00000, size =  1177848 bytes<br>
              [0.025s][info ][cds] CDS heap data relocation delta =
              -2097152 bytes<br>
              [0.025s][info ][aot] initial optimized module handling:
              disabled<br>
              [0.025s][info ][aot] initial full module graph: disabled<br>
              [0.025s][info ][aot] patching heap embedded pointers:
              narrowOop 0xfffc0000 -> 0xfff80000<br>
              [0.025s][info ][aot] heap data relocation quick delta =
              0xfffc0000<br>
              [0.027s][info ][cds] Unmapping region #2 at base
              0x00000001009d8000 (Bitmap)<br>
              [0.027s][info ][cds] Unmapping region #2 at base
              0x0000000101a8c000 (Bitmap)<br>
              [0.027s][info ][aot] Using AOT-linked classes: false
              (static archive: no aot-linked classes, dynamic archive:
              no aot-linked classes)<br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Thu, Oct 2, 2025 at
              11:58 AM Charles Oliver Nutter <<a href="mailto:headius@headius.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">headius@headius.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div dir="ltr">
                <div>Hello friends!</div>
                <div><br>
                </div>
                <div>I was doing some testing of AppCDS on JDK 25, in
                  hopes of having our Docker images pre-generate an
                  AppCDS archive. But I discovered an issue... AppCDS
                  does not appear to like the JRuby command line anymore
                  in JDK 25.</div>
                <div><br>
                </div>
                <div>Here's part of a session where I delete the old
                  AppCDS archive and then run the same command line
                  twice with AutoCreateSharedArchive. The archive
                  generates ok in the first command, but then is
                  rejected by the second command:</div>
                <div><br>
                </div>
                <div>[] jdk25 $ rm
                  /Users/headius/work/jruby/lib/jruby-java25.jsa<br>
                  [] jdk25 $
                  /Library/Java/JavaVirtualMachines/zulu-25.jdk/Contents/Home/bin/java
                  @/Users/headius/work/jruby/bin/.jruby.java_opts
                  @/Users/headius/work/jruby/bin/.jruby.module_opts
                  -Xss2048k
                  -Djffi.boot.library.path=/Users/headius/work/jruby/lib/jni
                  -Djava.security.egd=<a class="moz-txt-link-freetext" href="file:/dev/urandom" moz-do-not-send="true">file:/dev/urandom</a>
                  -XX:+AutoCreateSharedArchive
                  -XX:SharedArchiveFile=/Users/headius/work/jruby/lib/jruby-java25.jsa
                  --enable-native-access=org.jruby.dist
                  --sun-misc-unsafe-memory-access=allow --module-path
                  /Users/headius/work/jruby/lib/jruby.jar -classpath :
                  -Djruby.home=/Users/headius/work/jruby
                  -Djruby.lib=/Users/headius/work/jruby/lib
                  -Djruby.script=jruby -Djruby.shell=/bin/sh
                  org.jruby.Main -e 1<br>
                  [1.074s][warning][cds] Skipping jdk/proxy2/$Proxy13:
                  Unsupported location<br>
                  [1.074s][warning][cds] Skipping jdk/proxy2/$Proxy25:
                  Unsupported location<br>
                  [1.074s][warning][cds] Skipping
                  org/joda/time/field/MillisDurationField: Old class has
                  been linked</div>
                <div>...<br>
                  [1.076s][warning][cds] Skipping
                  org/jruby/org/objectweb/asm/ClassWriter: Old class has
                  been linked<br>
                  [1.076s][warning][cds] Skipping
                  org/joda/time/format/DateTimeFormatterBuilder$PaddedNumber:
                  Old class has been linked<br>
                  [] jdk25 $
                  /Library/Java/JavaVirtualMachines/zulu-25.jdk/Contents/Home/bin/java
                  @/Users/headius/work/jruby/bin/.jruby.java_opts
                  @/Users/headius/work/jruby/bin/.jruby.module_opts
                  -Xss2048k
                  -Djffi.boot.library.path=/Users/headius/work/jruby/lib/jni
                  -Djava.security.egd=<a class="moz-txt-link-freetext" href="file:/dev/urandom" moz-do-not-send="true">file:/dev/urandom</a>
                  -XX:+AutoCreateSharedArchive
                  -XX:SharedArchiveFile=/Users/headius/work/jruby/lib/jruby-java25.jsa
                  --enable-native-access=org.jruby.dist
                  --sun-misc-unsafe-memory-access=allow --module-path
                  /Users/headius/work/jruby/lib/jruby.jar -classpath :
                  -Djruby.home=/Users/headius/work/jruby
                  -Djruby.lib=/Users/headius/work/jruby/lib
                  -Djruby.script=jruby -Djruby.shell=/bin/sh
                  org.jruby.Main -e 1<br>
                  [0.008s][error][cds] An error has occurred while
                  processing the shared archive file. Run with
                  -Xlog:aot,cds for details.<br>
                  [0.008s][error][cds] optimized module handling:
                  disabled because extra module path(s) are specified<br>
                  [0.008s][error][cds] Mismatched values for property
                  jdk.module.enable.native.access: org.jruby.dist
                  specified during runtime but not during dump time<br>
                  [0.008s][error][cds] Disabling optimized module
                  handling<br>
                  [0.008s][error][cds] Mismatched values for property
                  jdk.module.addopens: java.base/<a href="http://java.io" target="_blank" moz-do-not-send="true">java.io</a>=org.jruby.dist,java.base/java.nio.channels=org.jruby.dist,java.base/<a href="http://sun.nio.ch" target="_blank" moz-do-not-send="true">sun.nio.ch</a>=org.jruby.dist,java.management/sun.management=org.jruby.dist
                  specified during runtime but not during dump time<br>
                  [0.008s][error][cds] Disabling optimized module
                  handling<br>
                </div>
                <div><br>
                </div>
                <div>The errors make no sense because I'm doing exactly
                  the same thing in both command lines.</div>
                <div><br>
                </div>
                <div>Here's the contents of the
                  /Users/headius/work/jruby/bin/.jruby.module_opts file
                  (the .jruby.java_opts file is empty):</div>
                <div><br>
                </div>
                <div>--add-opens java.base/<a href="http://java.io" target="_blank" moz-do-not-send="true">java.io</a>=org.jruby.dist<br>
                  --add-opens java.base/java.nio.channels=org.jruby.dist<br>
                  --add-opens java.base/<a href="http://sun.nio.ch" target="_blank" moz-do-not-send="true">sun.nio.ch</a>=org.jruby.dist<br>
                  --add-opens
                  java.management/sun.management=org.jruby.dist</div>
                <div><br>
                </div>
                <div>Running the same commands against JDK 21 works just
                  fine... the jsa file is generated and used correctly.
                  Is there something I'm doing wrong with this command
                  line that JDK 25 does not like?</div>
                <div><br>
                </div>
                <div>I can re-test with another JDK if necessary. Let me
                  know if I should open a bug for this.</div>
                <div><br>
                </div>
                <div>Reproduce by downloading JRuby from <a href="https://jruby.org" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://jruby.org</a>
                  and unpacking. It runs out of the box.</div>
                <div><br>
                </div>
                <div>
                  <div dir="ltr" class="gmail_signature">
                    <div dir="ltr"><b>Charles Oliver Nutter</b>
                      <div><i>Architect and Technologist</i></div>
                      <div>Headius Enterprises</div>
                      <a href="https://www.headius.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://www.headius.com</a>
                      <div>
                        <div><a href="mailto:headius@headius.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">headius@headius.com</a></div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>