Boost logo

Boost Users :

Subject: [Boost-users] boost::pool segfault
From: Robert Dean (bob.dean_at_[hidden])
Date: 2010-11-01 20:57:39


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



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net