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

Heterogeneous Heap may fail silently on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 12, 13, 14, 15
    • hotspot
    • None
    • gc

      https://github.com/openjdk/jdk/blob/f71f9dc93a6963ce36953e0ad770edd761afd0b4/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp#L87

      When JDK-8202286 (Allocation of old generation of Java heap on alternate memory devices) is enabled, we call ReservedSpace::first_part with (split == true).

      ReservedSpace::first_part() calls os::split_reserved_memory, which, on Windows, would release the space and try to reserve it again as two spaces. However, due to change in overall system memory pressure, the reservation attempts may fail.

      https://github.com/openjdk/jdk/blob/1332ba3c3c168d9fa368338e451c8c20a4c47ccc/src/hotspot/share/memory/virtualspace.cpp#L258

      ReservedSpace ReservedSpace::first_part(size_t partition_size, size_t alignment, bool split) {
        assert(partition_size <= size(), "partition failed");
        if (split && partition_size > 0 && partition_size < size()) {
          os::split_reserved_memory(base(), size(), partition_size);
        }
        ReservedSpace result(base(), partition_size, alignment, special(),
                             executable());
        return result;
      }

      https://github.com/openjdk/jdk/blob/1332ba3c3c168d9fa368338e451c8c20a4c47ccc/src/hotspot/os/windows/os_windows.cpp#L3120

      void os::split_reserved_memory(char *base, size_t size, size_t split) {
         ...
        release_memory(base, size);
        attempt_reserve_memory_at(base, split);
        attempt_reserve_memory_at(split_address, size - split);

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

              Created:
              Updated:
              Resolved: