5 ms·
We use a modified (by the author) jemalloc in a heavily threaded server that runs on Centos. The reason was due to memory fragmentation over time and jemalloc
by OnlyMortal 5y ago
We use a modified (by the author) jemalloc in a heavily threaded server that runs on Centos.
The reason was due to memory fragmentation over time and jemalloc reduced this to a level that we could live with.
We’ve tried other allocators over the years but still jemalloc, or our version of to be precise, is the winner in memory usage and fragmentation.
Edit: performance wise, gains can be had by doing your own memory pools on a per-thread basis and making use of stack objects rather than heap objects. Larger allocations for your own object pools and managing those reduces the calls to malloc also helps reduce memory fragmentation and your vmsize diverging from your rss.
- OnlyMortal 5y agoJust to add… std::vector can lead to fragmentation in heavily threaded applications. We found std::deque solved that issue.