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

Refactor CDSConfig::is_dumping_heap()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • 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.

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

              Created:
              Updated:
              Resolved: