id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 11419,Unexpected memory usage with unorderd_map,DarioOliveri ,Daniel James,"Unordered map does NO rehash when shrinking (erasing specific elements). When having multiple maps (or even one map) the memory usage become insanely high (arbitrary) and consequently the program lags because of insane cache usage This is not a memory leak, but a undocumented (and unwanted) behaviour. There are 3 possible ( I figured out ) fixes: - make rehashing when there are too few elements - fix documentation to clearly state users must rehash - add a method with the exact purpose of reducing memory usage I uploaded the code to reproduce the bug (bug present both in C++11/14 and in boost) here: *ttps://github.com/Darelbi/PublicProfileTests/blob/master/BoostMemoryUsage/UnorderedMap.cpp (beware! running the above code literally freeze also the operative system due to huge bandiwth usage). Fixing that problem as soon as possible could automatically increase performance in a lot of clients code, and that would reduce drastically memory usage (wich seems the problem with many applications, it is suprising no one profiled that!) ",Bugs,closed,To Be Determined,unordered,Boost Release Branch,Optimization,wontfix,,