Some interesting figures...
11 Sep 2007
I was wondering how many elements of a type can you store in a
1. HashMap
2. Vector
3. ArrayList
4. Stack
and other Collections.
This is what i found. With the default Heap space intact,
ArrayList can store 33,07,499 Long or Integers and around 1222441 Strings(I am not sure how long)
Stack and Vector, including HashMap can store upto 1236653 Strings. While around 26,21,441 integral types could be stored.
I am not sure if this is same across all machines. Well this atleast gives me an idea to what extent i can go without facing OutOfMemoryError.