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

Avoid relocating global roots to metaspaceObjs in CDS dump

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • hotspot
    • b23

      https://github.com/openjdk/jdk/blob/7d58978f62bf333f256115d6592706d70144ad15/src/hotspot/share/cds/archiveBuilder.cpp#L705-L729

      The functions ArchiveBuilder::relocate_roots() and ArchiveBuilder::relocate_vm_classes() walk over global roots such as vmClasses::_klasses[] and Universe::_typeArrayKlassObjs[] and modify their contents to point to locations inside the CDS "buffer" space.

      As a result, the VM is no longer usable after CDS dumping has finished.

      Previously, we tried to save some of the VM states and restore them after CDS dump has finished. See JDK-8264735

      However, this is too cumbersome and doesn't cover all cases. The intention of the global root relocation is to make it easy to write the roots using WriteClosure::do_ptr(). However, we can move the relocation logic inside WriteClosure::do_ptr() so that we don't need to modify the global VM state.

      (This RFE is a prerequisite to JDK-8306582)

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

              Created:
              Updated:
              Resolved: