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

Use private static final char[0] for empty Strings

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P5
    • 9
    • None
    • core-libs
    • b47
    • generic
    • generic

    Backports

      Description

        In an average heap dump, 292 kB is wasted from empty Strings having their own char[] of length 0. Instead, the String class should declare a zero-length char[] and use that for empty Strings. The constructor should detect that an empty String is being created and use the common char[].

        Attachments

          Issue Links

            Activity

              People

                lpriima Lev Priima
                nreynold Nathan Reynolds
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: