On 6 October 2017 at 11:41, Joaquin M López Muñoz via Boost-users
El 06/10/2017 a las 12:16, Ram via Boost-users escribió:
Hi,
I need help in determining the amount of memory used by boost::unordered_multimap and boost::unordered_multimap.
From a theoretical point of view, this might help:
http://bannalia.blogspot.com/2013/10/implementation-of-c-unordered.html
The implementation has changed recently, C++17 requires that unordered_map and unordered_multimap use the same nodes, so now the unordered_multimap nodes are a little smaller, and a bit slower when there are a lot of elements with equivalent keys as it has to iterate through them one by one. I also now store the bucket index in nodes instead of the hash value. The container still allocates an array of (bucket_count + 1) buckets, and each node consists of the value, a std::size_t, and a pointer, and also whatever housekeeping is required for memory management. This can be quite costly compared to storing values in an array.