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

Code duplication in ReservedSpace::initialize/ReservedHeapSpace::try_reserve_heap

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Other
    • Icon: P4 P4
    • tbd
    • 15
    • hotspot
    • gc

      The following code block is duplicated in ReservedSpace::initialize/ReservedSpace::try_reserve_heap (sans minor spacing):

        // If OS doesn't support demand paging for large page memory, we need
        // to use reserve_memory_special() to reserve and pin the entire region.
        // If there is a backing file directory for this space then whether
        // large pages are allocated is up to the filesystem of the backing file.
        // So we ignore the UseLargePages flag in this case.
        bool special = large && !os::can_commit_large_page_memory();
        if (special && _fd_for_heap != -1) {
          special = false;
          if (UseLargePages && (!FLAG_IS_DEFAULT(UseLargePages) ||
                                !FLAG_IS_DEFAULT(LargePageSizeInBytes))) {
            log_debug(gc, heap)("Cannot allocate large pages for Java Heap when AllocateHeapAt option is set.");
          }
        }

      Actually some more code below that block seems to be awfully similar too.

      Factor out this code to clean it up.

            stefank Stefan Karlsson
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: