This topic describes the memory management functions:
General Memory Functions
The following functions are used in memory management.
Data Execution Prevention Functions
The following functions are used with Data Execution Prevention (DEP).
File Mapping Functions
The following functions are used in file mapping.
| Function | Description |
| CreateFileMapping | Creates or opens a named or unnamed file mapping object for a specified file. |
| CreateFileMappingNuma | Creates or opens a named or unnamed file mapping object for a specified file, and specifies the NUMA node for the physical memory. |
| FlushViewOfFile | Writes to the disk a byte range within a mapped view of a file. |
| GetMappedFileName | Checks whether the specified address is within a memory-mapped file in the address space of the specified process. If so, the function returns the name of the memory-mapped file. |
| MapViewOfFile | Maps a view of a file mapping into the address space of a calling process. |
| MapViewOfFileEx | Maps a view of a file mapping into the address space of a calling process. A caller can optionally specify a suggested memory address for the view. |
| MapViewOfFileExNuma | Maps a view of a file mapping into the address space of a calling process, and specifies the NUMA node for the physical memory. |
| OpenFileMapping | Opens a named file mapping object. |
| UnmapViewOfFile | Unmaps a mapped view of a file from the calling process's address space. |
AWE Functions
The following are the
AWE functions.
Heap Functions
The following are the
heap functions.
| Function | Description |
| GetProcessHeap | Obtains a handle to the heap of the calling process. |
| GetProcessHeaps | Obtains handles to all of the heaps that are valid for the calling process. |
| HeapAlloc | Allocates a block of memory from a heap. |
| HeapCompact | Coalesces adjacent free blocks of memory on a heap. |
| HeapCreate | Creates a heap object. |
| HeapDestroy | Destroys the specified heap object. |
| HeapFree | Frees a memory block allocated from a heap. |
| HeapLock | Attempts to acquire the lock associated with a specified heap. |
| HeapQueryInformation | Retrieves information about the specified heap. |
| HeapReAlloc | Reallocates a block of memory from a heap. |
| HeapSetInformation | Sets heap information for the specified heap. |
| HeapSize | Retrieves the size of a memory block allocated from a heap. |
| HeapUnlock | Releases ownership of the lock associated with a specified heap. |
| HeapValidate | Attempts to validate a specified heap. |
| HeapWalk | Enumerates the memory blocks in a specified heap. |
Virtual Memory Functions
The following are the
virtual memory functions.
| Function | Description |
| VirtualAlloc | Reserves or commits a region of pages in the virtual address space of the calling process. |
| VirtualAllocEx | Reserves or commits a region of pages in the virtual address space of the specified process. |
| VirtualAllocExNuma | Reserves or commits a region of memory within the virtual address space of the specified process, and specifies the NUMA node for the physical memory. |
| VirtualFree | Releases or decommits a region of pages within the virtual address space of the calling process. |
| VirtualFreeEx | Releases or decommits a region of memory within the virtual address space of a specified process. |
| VirtualLock | Locks the specified region of the process's virtual address space into physical memory. |
| VirtualProtect | Changes the access protection on a region of committed pages in the virtual address space of the calling process. |
| VirtualProtectEx | Changes the access protection on a region of committed pages in the virtual address space of the calling process. |
| VirtualQuery | Provides information about a range of pages in the virtual address space of the calling process. |
| VirtualQueryEx | Provides information about a range of pages in the virtual address space of the calling process. |
| VirtualUnlock | Unlocks a specified range of pages in the virtual address space of a process. |
Global and Local Functions
The following are the
global and local functions. These functions are provided for compatibility with 16-bit Windows and are used with Dynamic Data Exchange (DDE), the clipboard functions, and OLE data objects. Unless documentation specifically states that a global or local function should be used, new applications should use the corresponding heap function with the handle returned by GetProcessHeap. For equivalent functionality to the global or local function, set the heap function's dwFlags parameter to 0.
Obsolete Functions
The following functions are provided only for compatibility with 16-bit versions of Windows:
The following function can return incorrect information and should not be used. Use the GlobalMemoryStatusEx function instead:
Send comments about this topic to Microsoft
Build date: 11/19/2009