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

Optimize empty CopyOnWriteArrayList allocations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 17, 21, 22, 23
    • core-libs
    • None

      We have seen the cases in production where lots of empty CopyOnWriteArrayList-s take a considerable amount of memory/instances. We can follow the example how other collections handled these cases, and initialize with a shared empty array instance.

      See e.g. JDK-8035584 for ArrayList: https://github.com/openjdk/jdk/commit/e0c3c7a07de23cca0ee938eb64af973d567fcdaf

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: