KeepAliveCache questionable code

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • tbd
    • Affects Version/s: 10
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: