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

releasing oopStorage when deflating allows for faster deleting

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 16
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      The loop for deleting ObjectMonitor is slow because of the transition to blocked for each iteration.
      If we release oopStorage when deflating we can do this entire loop while blocked instead, which will be much faster.
      Since we only need to free some c-heap.
      From similar situations the differences can be up to 10x, mainly due to compiler may use much more aggressive optimizations and much better predictions (the list is random access).
      In rare situations when we have a list with 10 k OMs, using 10 usec per item instead of 100 usec can mean we will not "get behind".

      E.g. we then could do:
      > size_t deleted_count = 0;
      > ThreadBlockInVM tbivm(self);
      > for (ObjectMonitor* monitor: delete_list) {
      > delete monitor;
      > deleted_count++;
      > }
      > }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              dcubed Daniel Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: