I am profiling my program using Google Perf tools and find that I am running out of memory on std::string::_Rep::_S_create. Perf tools shows 20gb in use:
20526.0 92.1% 92.1% 20526.0 92.1% std::string::_Rep::_S_create
Does anyone know what this could be? So far I've found:
- Suggestions that the std::string allocator could be grabbing large chunks of memory to avoid calling new.
- std::string destructor does not get called due to exit() or some such call. So far I have not found any evidence of this in my program.
Any other ideas about how I could track this down?
Thanks.
Edit:
Via this answer I moved libstdc++ to shared and enabled GLIBCXX_FORCE_NEW and that seems to have fixed the problem. It's still unclear to me why the issue occurred in the first place though. Anyone have an idea?