previousupnext

8.2 Program Performance

Dynamic Memory Usage

Some programs do not allocate dynamic memory at all, and that can be an attractive policy even for large applications, as statically assigned memory is faster than the best heap manager. Most applications do use some form of heap because of the flexibility it provides. Visual Basic programs and COM servers are heavy heap users.

NT Heap Usage

Programs that use dynamic memory have various strategies for allocating it; not all of these strategies revolve around the NT heap API. Ironically, the poor past performance of heap managers has tempted application designers to find workarounds, and applications that do not use the NT native heap cannot benefit from LeapHeap. An alternative to the heap API is offered by the memory management function VirtualAlloc; some applications obtain large blocks of memory using this and parcel it up themselves. Relational database management systems may use the NT heap for ancillary purposes, but for storing database tables they are likely to manage their own memory.

Compiler Strategies

Most application-building tools arrange that the code they output uses the NT heap, but there are some that only use it for allocations above a threshold and manage their own 'small-block heap' for sizes below the threshold. Earlier versions of Visual C++ fall into this category.