From: Jim Balson on
Giovanni Dicanio wrote:
> NianHawk wrote:
>> would frequent allocation and release of small buffers definitely
>> cause memory leaks?
>
> No, if you properly free every allocated buffer.
>
>> My application have to allocate small buffer for sending data and then
>> release it after it is done very frequently. I am not sure whether it
>> would cause memory fragmentation and thus poor performance? Your help
>> would be appreciated.
>
> If you have a need to do frequent allocations of small chunks (e.g. when
> you are handling node-based structures like tress, e.g. when processing
> XML nodes, etc.), you may want to use a custom allocator, and not the
> default VC++'s one.
>
> You may find the following links to be useful:
>
> http://g.oswego.edu/dl/html/malloc.html
> http://www.hoard.org/


Haven't looked at one from oswego.edu, but hoard is slow. It is barely
faster than the algorithms shipped by Microsoft. In most cases it's a
lot slower.

Look at ESA:

http://www.cherrystonesoftware.com

Very fast. Highly scalable.

HTH.


Jim