Refactor CDSConfig::is_dumping_heap()

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 25
    • Affects Version/s: None
    • Component/s: hotspot
    • b09

      There's overlap between HeapShared::can_write() and CDSConfig::is_dumping_heap(). The former can return true while the latter returns false:

      https://github.com/openjdk/jdk/blob/8cf0735839727300e446828f4f4a8ef6354a8c7a/src/hotspot/share/cds/cdsConfig.cpp#L531-L534

      bool CDSConfig::is_dumping_heap() {
        // heap dump is not supported in dynamic dump
        return is_dumping_static_archive() && HeapShared::can_write();
      }

      We have lots of places where "if (HeapShared::can_write())" should be rewritten as "if (CDSConfig::is_dumping_heap())".

      Also, all the logic of deciding whether heap objects can be dumped should be consolidated into the CDSConfig class.

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

              Created:
              Updated:
              Resolved: