I used unordered_multiset in my code by the following two reasons,
- Should be easy to find or look up the data.
- Should supports to load duplicate values.
unordered_multiset are typically much faster than multisets & vector, both for insertion and for lookup, and sometimes even for deletion.
But the bad thing is,it takes too much of memory.
I have stored unsigned __int64 (8 bytes)values in the unordered_multiset and properly clear the values from the unordered_multiset. can you anyone explain,why its taking the memory & how to solve this memory consumption?
You can get a much better measurement of how much space a
std::
container uses by providing it with a custom allocator that logs how much it is asked to allocate.e.g.