http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51386
--- Comment #7 from François Dumont <fdumont at gcc dot gnu.org> 2011-12-05 20:55:59 UTC --- The problem is in the hash policy, while computing _M_prev_resize the max load factor is not always considered. The result is that when max load factor is lower than 1 the hashtable is rehashed almost each time we insert a new element. I have submitted a patch on mailing list and wait for its approval. Sorry for the inconvenience. Note that memory was not really a suspect cause the hash code is not put in cache for integral types like the int used in the test.