Tuesday, September 11, 2007

Some interesting figures...

I was wondering how many elements of a type can you store in a1. HashMap2. Vector3. ArrayList4. Stackand 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.