-
Enhancement
-
Resolution: Won't Fix
-
P3
-
None
-
6
-
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.
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.