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

Avoid calling FileMapInfo::write_region twice

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 14
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b16

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: