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

Use private static final char[0] for empty Strings

XMLWordPrintable

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

        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[].

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

                Created:
                Updated:
                Resolved: