You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Andrew Stitcher <as...@redhat.com> on 2007/03/15 16:03:47 UTC

Use of memory pools

In my recent thinking about improving C++ broker scalability, I've also
been wondering whether it would be appropriate to use memory allocation
pools in the C++ broker.

It occurs to me that there are various things that are allocated and
held only so long as various things exist. For example there is a lot of
state that is held for each channel. Perhaps it would make sense that it
could all be deleted en masse when the channel is closed.

This obviously works better from an efficiency point of view in C where
you don't also have to run the destructors, but it might guard against
memory leaks.

Any thoughts?

Andrew



Re: Use of memory pools

Posted by Alan Conway <ac...@redhat.com>.
Andrew Stitcher wrote:
> In my recent thinking about improving C++ broker scalability, I've also
> been wondering whether it would be appropriate to use memory allocation
> pools in the C++ broker.
>
> It occurs to me that there are various things that are allocated and
> held only so long as various things exist. For example there is a lot of
> state that is held for each channel. Perhaps it would make sense that it
> could all be deleted en masse when the channel is closed.
>
> This obviously works better from an efficiency point of view in C where
> you don't also have to run the destructors, but it might guard against
> memory leaks.
>
> Any thoughts?
>   
Definitely worth considering. boost has pool templates so we don't have 
to invent the wheel.