in my application there are tons of small malloc
/free
events with a high infant mortality rate. Normally I would write my own memory pool, but after seeing the performance of using tcmalloc
I am tempted to use a replacement malloc. Are there any implementations with similar performance to a raw memory pool implementation?
For C++, I have another application that does the C++ new
/delete
dance. Assume the same high infant mortality rate. Two part question:
1) How would I implement a memory pool that acts on the new
and delete
operations?
2) Is there a transparent way, akin to the glibc malloc dynamic library features, to replace the new
/delete
memory allocator for all classes?
Have you considered using boost pools? I use that for my base small object allocator and have no complaint. It has both thread safe and non-safe versions as well for ease of use. There are also a bunch of other specific small object allocators out and about you can consider as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With