Use private static final char[0] for empty Strings

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 9
    • Affects Version/s: None
    • Component/s: 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[].

              Assignee:
              Lev Priima
              Reporter:
              Nathan Reynolds
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: