|
Boost Users : |
Subject: Re: [Boost-users] Memory usage of boost::unordered_multimap and boost::unordered_multimap
From: Ram (sourceopen_at_[hidden])
Date: 2017-10-06 10:22:03
Can this be done by doing this,
unsigned n = mymap.bucket_count();
float m = mymap.max_load_factor();
if (m > 1.0) {
return (n * m) * (sizeof(value_type stored));
}
else {
return n * (sizeof(value_type stored));
}
to get an approimate size?
I got this idea from this question's answer -
https://stackoverflow.com/questions/25375202/how-to-measure-memory-usage-of-stdunordered-map
Thanks!
On Fri, Oct 6, 2017 at 3:46 PM, Ram <sourceopen_at_[hidden]> wrote:
> Hi,
>
> I need help in determining the amount of memory used
> by boost::unordered_multimap and boost::unordered_multimap. We have a large
> code base and we have some optimizations done using boost::unordered_multimap
> and boost::unordered_multimap. The speed it really good, but we want to
> measure the amount of space it is occupying.
>
> Can somebody please help with that?
>
> I would not be able to change to use a custom new/delete.
>
> Thanks
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net