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

os::attempt_reserve_memory_at records reserved memory twice

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • 11
    • hotspot

      os::attempt_reserve_memory_at calls:

      result = pd_attempt_reserve_memory_at(bytes, addr);
      if (result != NULL) {
          MemTracker::record_virtual_memory_reserve_and_commit((address)result, bytes, CALLER_PC);
      }

      pd_attempt_reserve_memory_at calls:

      os::reserve_memory, which calls:

      result = pd_reserve_memory(bytes, addr, alignment_hint);
      if (result != NULL) {
        MemTracker::record_virtual_memory_reserve((address)result, bytes, CALLER_PC);
      }

      This has the effect that we call NMT in this sequence:
        MemTracker::record_virtual_memory_reserve(...)
        MemTracker::record_virtual_memory_reserve_and_commit(...)

      After JDK-8198225 the sequence will be:
        MemTracker::record_virtual_memory_reserve(...)
        MemTracker::record_virtual_memory_reserve(...)

      We should probably only be calling record_virtual_memory_reserve once when calling os::attempt_reserve_memory_at.


            jsjolen Johan Sjölen
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: