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

KeepAliveCache questionable code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • 10
    • core-libs
    • None

      While investigating JDK-8185090 I noticed that KeepAliveCache.run could be better implemented.

      It looks like this code

                      for (KeepAliveKey key : keysToRemove) {
                          removeVector(key);
                      }

      acquires the lock for every key, but we're already holding the lock, and it looks like a simple

      removeAll(keysToRemove)

      would suffice.

      I'm sure there's more low-hanging fruit here, if we cared to fix.

            Unassigned Unassigned
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: