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!
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