Quantcast
Channel: Java collections memory consumption - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Java collections memory consumption

$
0
0

Say I instantiate 100 000 of Vectors

a[0..100k] = new Vector<Integer>();

If i do this

a[0..100k] = new Vector<Integer>(1);

Will they take less memory? That is ignoring whether they have stuff in them and the overhead of expanding them when there has to be more than 1 element.


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images