   Boost Memory Pool allocators
  Hi to everyone,I have several problems with Boost 1.391.Problem, pool_allocator in stl containersIf I am doing like this:class A {//some data};std::vector<A, boost::pool_allocator<A> > vec;   A a;   v.push_back(a);//this is what the documentation says about releasing the allocated vector.bool memFree = boost::singleton_pool<boost::pool_allocator_tag, sizeof(A)>::release_memory()is there some other way around this? because I do not want to realeas all pool memory, only for that vector.2.Problem, Is boost pool_allocator or fast_pool_allocator for STL is so good in performance?3.Problem, if I am using visial leak detector 1.9d, it doesn't detect any memory leak by using the boost memory pool. Maybe boost library itself contains some classes for memory leak detection?Thanks,Yanis
  There is boost::object_pool<> which provides pooling for its scope and so is more flexible. However it doesn't provide a standard allocator interface so you cannot use it as a drop in allocator for stl containers. So far as I know, the boost pool stuff doesn't offer a more flexible way to manage lifetime of pool objects with a standard allocator interface - its a glaring deficiency really. You could implement your own allocator structure over the top of it but then again its probably just as simple to just write your own meeting the allocator requirements.There is no value in using a pooling allocator for std::vector's since they allocate/free fairly infrequently. For std::list and set and map where each elements requires an allocation they might be useful. Anecdotally, I got a speed up of around 1.5 to 2 times using the boost::fast_pool_allocator<>, which in my mind indicates the normal allocators are really good at managing their store - eg it wasnt worth it.   ;  Thanks a lot   