Hello, I attempted to use the boost::pool STL allocators for a work project which uses millions of objects as part of a memory resident data store. Unfortunately, this caused the program to always segfault with a std::bad_alloc error during initialization. Looking into the problem, it seems to be due to the "next_size <<= 1;" line found in malloc_need_resize and ordered_malloc_need_resize methods. Near as I can tell, every-time boost::pool allocates a new storage chunk it doubles the size request for the next allocation. For an application which uses gigabytes of storage, this means the memory pool requests more memory than the application uses without the pool, as well as sizes larger than the kernel can supply. Is there any way to control this behavior? Or do I have to write my own memory pool? Thanks you, Bob
participants (1)
-
Robert Dean