Home

Pete Becker wrote:
> 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.
>

If this is the way to go in order to find the size of the of an STL
container, then, did anyone created such an allocator? Did anyone
created an allocator that acts as the default one, but also keeps track
of the number of allocated bytes? I assume this can also be done by
starting from the default allocator and adding some counters.

Thanks,
Ray

previous
next

Re: Order of statements using if
Are there precompiled python for sgi ?
Re: units hijnks
Re: conversion between string and numerical value
Re: Try this
pozycjonowanie stron ruda śląska
wakacyjne oferty 2012
upominki reklamowe
pościele
fotele do pedicure