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

Minor issues during MetaspaceShared::initialize_runtime_shared_and_meta_spaces

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 12
    • Fix Version/s: 12
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b21

      Description

      I noticed this issue while looking into shared space and class space allocations for dynamic archiving. In MetaspaceShared::initialize_runtime_shared_and_meta_spaces(), the compressed class space start is computed as cds_base+cds_total_size. The cd_total_size is MetaspaceShared::core_spaces_size(), which is only valid at dump time. At runtime, MetaspaceShared::core_spaces_size() is 0. As as result, it tries to allocate the class space at the beginning of the mapped shared space, and the first ReservedSpace() fails (in Metaspace::allocate_metaspace_compressed_klass_ptrs). Then it needs to retry at an address that 1G above the initial address.

      There is another issue with MetaspaceShared::initialize_runtime_shared_and_meta_spaces(). If shared space mapping fails due to shared_path validation failure, map_shared_spaces() may still return 'true'. That is because FileMapInfo::validate_shared_path_table() does not handle shared_path(i)->validate failure properly. The 'else' case in MetaspaceShared::initialize_runtime_shared_and_meta_spaces would not be taken in that case.



        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jiangli Jiangli Zhou
                Reporter:
                jiangli Jiangli Zhou
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: