c++ vector memory taken

March 2nd, 2010 by xrigher Leave a reply »

Here is a experiment about how much memory will a vector array take with different size on a 64bit machine with a 64bit OS (Ubuntu).

Vector Arr Size   Memory
10K * 1             208K
10K * 10           688K
10K * 100         5.4M
10K * 1000       52.8M
12K * 100         12.3M
100K * 10         10M
300K * 10         30M
300K * 100        158M

Note: 10K * 1 means an array of 10K vectors with each vector having 1 int element.

Advertisement

Leave a Reply