I need to store a large amount of information, say for example \'names\' in a java List. The number of items can change (or in short I cannot predefine the size). I am of th
ArrayList.trimToSize() may satisfy you.
Trims the capacity of this ArrayList instance to be the list's current size. An application can use this operation to minimize the storage of an ArrayList instance.
By the way, in ArrayList Java6, it's not double capacity, it's about 1.5 times max size is reached.