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

Optimize empty CopyOnWriteArrayList allocations

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: