Skip to main content

XMemFreePhysicalPages

Releases pages allocated with XMemAllocatePhysicalPages back to the memory manager.

Syntax

Parameters

NumberOfPages   _In_
Type: ULONG_PTR
The number of physical memory pages to free. PageArray   _In_reads_(NumberOfPages)
Type: PULONG_PTR
A pointer to an array of page frame numbers for the allocated memory to be freed.

Return value

Type: BOOL If the function frees the number of pages specified in NumberOfPages, the return value is TRUE; otherwise, the function returns FALSE, and NumberOfPages is set to the number of pages that were actually released. To get extended error information, call GetLastError.

Remarks

Use this function to free physical pages previously allocated by calling the XMemAllocatePhysicalPages function. Fewer pages than requested in NumberOfPages may be freed. If the function returns FALSE, check the value returned in NumberOfPages to see how many pages were actually freed. For more information about working with physical pages, see Working with the Microsoft GDK Game OS memory manager.

Requirements

Header: xmem.h Library: xmem.lib Supported platforms: XBOX One family consoles and XBOX Series consoles

See also

XMemAllocatePhysicalPages
XMem
Last modified on August 20, 2026