Boost Users :
Subject: Re: [Boost-users] [boost::pool] using many pools in the application
From: Boris (boriss_at_[hidden])
Date: 2008-10-30 09:55:00
On Wed, 29 Oct 2008 14:34:53 +0100, Roman Shmelev <rshmelev_at_[hidden]>
> Are there any thoughts if using many boost::pool objects ( from 50 to
> 1000 to maybe 5000 ) in my application will be efficient or not?
> During the "long" run my program just allocates new chunks, and the
> deletion of them is done in the end of the program.
> The reason I use boost::pool is that my simple tests showed me that
> boost::pool allocates memory 10x faster than standard _new_ operator.
> But I'm suffering that 1000 pools will cause some kind of memory
> fragmentation or smth like that... so maybe it will be better to use
> _new_ operator? I can make some another test for multiple pools, but
> we know that real application will act in some other way, and I cannot
> make a decision.
Do you really need so many pools? As a pool simply allocates chunks of a
single size you only need more than one pool if you need to allocate
chunks of different size. That said you only need 5000 pools if you need
to allocate 5000 chunks of different size?
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