Resources | Resources |




Many applications (compilers, web browsers, etc.) require large numbers of relatively small allocations. It is typically more efficient to use the stack instead of the heap for small allocations that are temporary within the method. If heap allocations are performed with a generalized heap manager, these larger numbers of allocations can be very expensive due to the time spent coalescing freed blocks, integrity checking, tagging, etc.

A strategy to improve performance is to allocate a large block of memory from the heap and use it as a pool of many smaller fixed-sized blocks. Allocation from such a pool can be much faster than from a generalized heap because there is no coalescing of freed blocks, and behavior of the suballocator pool can be fine-tuned specifically for the application.

In Brew MP, frequent small allocations should be replaced with a local sub-allocator such as IHeapFactory().