UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGenericPlatformMemoryConstants Struct Reference

#include <GenericPlatformMemory.h>

+ Inheritance diagram for FGenericPlatformMemoryConstants:

Public Attributes

uint64 TotalPhysical = 0
 
uint64 TotalVirtual = 0
 
SIZE_T PageSize = 0
 
SIZE_T OsAllocationGranularity = 0
 
SIZE_T BinnedPageSize = 0
 
SIZE_T BinnedAllocationGranularity = 0
 
uint64 AddressStart = 0
 
uint64 AddressLimit = (uint64)0xffffffff + 1
 
uint32 TotalPhysicalGB = 1
 

Detailed Description

Struct used to hold common memory constants for all platforms. These values don't change over the entire life of the executable.

Member Data Documentation

◆ AddressLimit

uint64 FGenericPlatformMemoryConstants::AddressLimit = (uint64)0xffffffff + 1

An estimate of the range of addresses expected to be returned by BinnedAllocFromOS(). Binned Malloc will adjust its internal structures to make lookups for memory allocations O(1) for this range. It is ok to go outside this range, lookups will just be a little slower

◆ AddressStart

uint64 FGenericPlatformMemoryConstants::AddressStart = 0

Starting address for the available virtual address space. Can be used with AddressLimit to determine address space range for binned allocators

◆ BinnedAllocationGranularity

SIZE_T FGenericPlatformMemoryConstants::BinnedAllocationGranularity = 0

This is the "allocation granularity" in Binned malloc terms, i.e. BinnedMalloc will allocate the memory in increments of this value. If zero, Binned will use BinnedPageSize for this value.

◆ BinnedPageSize

SIZE_T FGenericPlatformMemoryConstants::BinnedPageSize = 0

The size of a "page" in Binned2 malloc terms, in bytes. Should be at least 64KB. BinnedMalloc expects memory returned from BinnedAllocFromOS() to be aligned on BinnedPageSize boundary.

◆ OsAllocationGranularity

SIZE_T FGenericPlatformMemoryConstants::OsAllocationGranularity = 0

Some platforms have advantages if memory is allocated in chunks larger than PageSize (e.g. VirtualAlloc() seems to have 64KB granularity as of now). This value is the minimum allocation size that the system will use behind the scenes.

◆ PageSize

SIZE_T FGenericPlatformMemoryConstants::PageSize = 0

The size of a physical page, in bytes. This is also the granularity for PageProtect(), commitment and properties (e.g. ability to access) of the physical RAM.

◆ TotalPhysical

uint64 FGenericPlatformMemoryConstants::TotalPhysical = 0

The amount of actual physical memory, in bytes (needs to handle >4GB for 64-bit devices running 32-bit code).

◆ TotalPhysicalGB

uint32 FGenericPlatformMemoryConstants::TotalPhysicalGB = 1

Approximate physical RAM in GB; 1 on everything except PC. Used for "course tuning", like FPlatformMisc::NumberOfCores().

◆ TotalVirtual

uint64 FGenericPlatformMemoryConstants::TotalVirtual = 0

The amount of virtual memory, in bytes.


The documentation for this struct was generated from the following file: