I need some fast, thread safe memory pooling library. I've googled a lot, but fast solutions don't have thread safety, while others are really big.
Any suggestions?
A memory pool is a logical division of main memory or storage that is reserved for processing a job or group of jobs. On your system, all main storage can be divided into logical allocations called memory pools. By default, the system manages the transfer of data and programs into memory pools.
Pools are generally used when there is a lot of allocation and deallocation of small objects. Another common usage is the situation above, where many objects may be dropped out of memory. In general, use Pools when you need a more efficient way to do unusual memory control.
Both memory pools are located in the region of the address space that is reserved for the system and mapped into the virtual address space of each process. The nonpaged pool consists of virtual memory addresses that are guaranteed to reside in physical memory as long as the corresponding kernel objects are allocated.
Boost. Pool is a library that contains a few classes to manage memory. While C++ programs usually use new to allocate memory dynamically, the details of how memory is provided depends on the implementation of the standard library and the operating system.
Both nedmalloc and ptmalloc are C based thread caching memory managers, based around doug lea's malloc(the core of most linux allocators). They are both under good licences as well, unlike hoard, which requires payment for commercial use, last I looked. Googles tcmalloc also has C bindings iirc, and is built from the ground up as a thread caching allocator, as well as some built in heap and cpu profiling tools, it is however build for massive memory usage(the example they give is 300mb+ per thread), and as such many not work as well as expected for smaller scale apps
You're supposed to use one memory pool per thread.
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