Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8350916

Remove misleading warning "Cannot dump shared archive while using shared archive"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • hotspot
    • b13

      https://github.com/openjdk/jdk/blob/ab4b0ef9242a4cd964fbcf2d1f3d370234c09408/src/hotspot/share/cds/cdsConfig.cpp#L70-L74

      void CDSConfig::initialize() {
        if (is_dumping_static_archive() && !is_dumping_final_static_archive()) {
          if (RequireSharedSpaces) {
            warning("Cannot dump shared archive while using shared archive");
          }
          UseSharedSpaces = false;
        }

      The warning message can never be printed with JDK 25 mainline:

      * -Xshare and -XX:AOTMode flags are mutually exclusive:
      * Class workflow: -Xshare:on and -Xshare:dump cannot take effect at the same time.
      * JEP 483 workflow: -XX:AOTMode:record and -XX:AOTMode=on cannot take effect at the same time.

      We should replace the inner "if" statement with the following comment:

          // If dumping the classic archive, or making an AOT training run (dumping a preimage archive),
          // for sanity, parse all classes from classfiles.
          // TODO: in the future, if we want to support re-training on top of an existing AOT cache, this
          // needs to be changed.

      =======
      Note: for the Leyden repo ONLY, it's possible to trigger a cds dump with the experimental flag "-Xshare:on -XX:CacheDataStore". We should print a more appropriate message like

          if (RequireSharedSpaces) {
            if (is_leyden_workflow()) {
              log_info(cds)("-Xshare:on flag is ignored when creating a CacheDataStore");
            } else {
              ShouldNotReachHere().
            }

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: