Virtual Memory

Windows offers three distinct types of memory to applications: virtual memory, heaps, and shared memory. Virtual memory is best used for managing large arrays or collections of objects or structures of varying sizes. It is the primary mechanism by which SQL Server allocates memory and is the focus of this section.

You allocate virtual memory using the VirtualAlloc and VirtualAllocEx API functions. VirtualAlloc allocates memory only in the calling process's address space; VirtualAllocEx can allocate memory in another process's address space. VirtualAlloc is by far the more commonly used of the two, and it's the one we'll use throughout this chapter.

Pages in virtual memory are always in one of three states: free, reserved, or committed. ...

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.