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

RFE: ArrayList, Vector, and HashMap should not be used in JRE with their default constructor

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 6
    • other-libs
    • None
    • sparc
    • solaris_10

      The following classes of the java.util package have initial sizes
      that are defined small in the default constructor:

                            initial size/capacity
      java.util.ArrayList: 10
      java.util.Vector: 10
      java.util.HashMap: 16

      Using the default constructor may create objects that are too small
      in their initial size. This may entail frequent resizing steps and
      unnecessary garbage collector activity, which both affect performance
      adversely.

      For this reason, in JRE it should be avoided as much as possible to
      use the default constructor for these classes, when the object can
      be constructed with a reasonable initial size.

            Unassigned Unassigned
            thlenz Thomas Lenz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: