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

Avoid calling FileMapInfo::write_region twice

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 14
    • None
    • hotspot
    • b16

      We call FileMapInfo::write_region twice in a loop:

      http://hg.openjdk.java.net/jdk/jdk/file/ee37c9b2eb61/src/hotspot/share/memory/metaspaceShared.cpp#l1552

      + The first time just to store the CRC and offset of the region into the file header
      + then we compute CRC of the header and write the header
      + then we call write_region a second time to actually write it

      This is too awkward. We should just write the regions, and then seek the fd back to the beginning of the file, and then write the header.

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

              Created:
              Updated:
              Resolved: