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

Remove debug-only heap overrun checks in os::malloc and friends

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 18
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
      None

      Description

      As a second step after integrating C heap overrun checks into NMT (JDK-8275301), we can now remove debug-only guarding memory for os::malloc() and friends. For the whole ratio, please refer to the umbrella JBS (JDK-8275301).

      This will:
      - reduce complexity of os::malloc, os::realloc (especially this, realloc is tricky to get right) and os::free
      - reduce memory overhead in debug builds; depending on malloc granularity, this can be significant
      - reduce CPU overhead. Not sure if its measurable, but we do less now.
      - make debug VMs behave much more similarly to release VMs in terms of memory layout of allocations, and make both travel more similar code paths. That improves testing coverage and makes it easier to reproduce errors with debug VMs (same memory layout).

      Currently we have always-on heap overrun checks in debug VMs. In order to get this after the patch, NMT should be switched on always in debug. NMT level summary is *very* cheap. Memory overhead will probably less than what we paid before with the quite generous debug-only guards. NMT accounting is minimal and, again, should not be worse than what we did before - adjusting some global counters, in case of NMT per NMT category.

      Finally, this would also be a good coverage test for NMT.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              stuefe Thomas Stuefe
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: