On 2007-10-01 15:46:44 -1000, Rares Vernica <rvernica@gmail.com> said:
>
> How can I determine how much memory is used by various STL containers?
>
> For example, I have a vector<int>, I know that an int takes 4B and I
> have 10 elements in my vector. So, I know that that my vector will take
> at least 40B, but I would like to know more exactly. I would like to
> know how much more does the vector needs for its stuff.
>
> I also need to know the memory size for set and map (unordered_map).
>
Write your own allocator to track memory usage.
--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)