Heaps

A heap is a memory region consisting of one or more pages of reserved space that can be suballocated into smaller pieces by the heap manager. Heaps are most useful for allocating large numbers of similarly sized, relatively small objects and structures. You should not use heaps for blocks of 1MB or more; use VirtualAlloc and company for large allocations such as this.

On the plus side, heaps allow you to ignore the system's allocation granularity and page size boundaries. On the negative side, heaps are a bit slower to access and don't provide the same level of control that the virtual memory APIs do. For example, you can't reserve a heap region without also committing it—VirtualAlloc is the only Win32 allocation function that separates ...

Get Guru's Guide to SQL Server Architecture and Internals, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.