O'Reilly logo

Guru's Guide to SQL Server Architecture and Internals, The by Ken Henderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required