UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AndroidPlatformMemory.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4/*=============================================================================================
5 AndroidPlatformMemory.h: Android platform memory functions
6==============================================================================================*/
7
8#pragma once
10
21
26{
27 //~ Begin FGenericPlatformMemory Interface
28 static CORE_API void Init();
35 static CORE_API void BinnedFreeToOS(void* Ptr, SIZE_T Size);
36
85
86 static CORE_API bool GetLLMAllocFunctions(void*(*&OutAllocFunction)(size_t), void(*&OutFreeFunction)(void*, size_t), int32& OutAlignment);
87 //~ End FGenericPlatformMemory Interface
88
89 // ANDROID ONLY:
90 enum class ETrimValues
91 {
92 Unknown = -1,
93 Complete = 80, // the process is nearing the end of the background LRU list, and if more memory isn't found soon it will be killed.
94 Moderate = 60, // the process is around the middle of the background LRU list
95 Background = 40, // the process has gone on to the background LRU list.
96 UI_Hidden = 20, // the process had been showing a user interface, and is no longer doing so...
97 Running_Critical = 15, // the process is not an expendable background process, but the device is running extremely low on memory and is about to not be able to keep any background processes running..
98 Running_Low = 10, // the process is not an expendable background process, but the device is running low on memory.
99 Running_Moderate = 5 // the process is not an expendable background process, but the device is running moderately low on memory.
100 };
101 // called when OS (via JNI) reports memory trouble, triggers MemoryWarningHandler callback on game thread if set.
104
105 static void AndroidMemoryProbeStart();
106 static void AndroidMemoryProbeStop();
107 static void AndroidMemoryProbeTick();
108};
109
111
112
113
FAndroidPlatformMemory FPlatformMemory
Definition AndroidPlatformMemory.h:110
@ BinnedAllocFromOS
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EPlatformMemorySizeBucket
Definition GenericPlatformMemory.h:54
uint32 Size
Definition VulkanMemory.cpp:4034
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AndroidPlatformMemory.h:38
void FreeVirtual()
Definition AndroidPlatformMemory.cpp:622
UE_FORCEINLINE_HINT void CommitByPtr(void *InPtr, size_t InSize)
Definition AndroidPlatformMemory.h:56
FPlatformVirtualMemoryBlock(const FPlatformVirtualMemoryBlock &Other)=default
UE_FORCEINLINE_HINT size_t GetActualSize() const
Definition AndroidPlatformMemory.h:76
UE_FORCEINLINE_HINT void DecommitByPtr(void *InPtr, size_t InSize)
Definition AndroidPlatformMemory.h:61
static size_t GetCommitAlignment()
Definition AndroidPlatformMemory.cpp:595
FPlatformVirtualMemoryBlock(void *InPtr, uint32 InVMSizeDivVirtualSizeAlignment)
Definition AndroidPlatformMemory.h:45
FPlatformVirtualMemoryBlock & operator=(const FPlatformVirtualMemoryBlock &Other)=default
FPlatformVirtualMemoryBlock()
Definition AndroidPlatformMemory.h:41
static size_t GetVirtualSizeAlignment()
Definition AndroidPlatformMemory.cpp:589
UE_FORCEINLINE_HINT void Commit()
Definition AndroidPlatformMemory.h:66
UE_FORCEINLINE_HINT void Decommit()
Definition AndroidPlatformMemory.h:71
static FPlatformVirtualMemoryBlock AllocateVirtual(size_t Size, size_t InAlignment=FPlatformVirtualMemoryBlock::GetVirtualSizeAlignment())
Definition AndroidPlatformMemory.cpp:601
Definition GenericPlatformMemory.h:469
void * Ptr
Definition GenericPlatformMemory.h:471
uint32 VMSizeDivVirtualSizeAlignment
Definition GenericPlatformMemory.h:472
Definition MemoryBase.h:99
Definition AndroidPlatformMemory.h:26
static void AndroidMemoryProbeStop()
Definition AndroidPlatformMemory.cpp:752
EOSMemoryStatusCategory
Definition AndroidPlatformMemory.h:102
static CORE_API EPlatformMemorySizeBucket GetMemorySizeBucket()
Definition AndroidPlatformMemory.cpp:449
static CORE_API FMalloc * BaseAllocator()
Definition AndroidPlatformMemory.cpp:456
static void AndroidMemoryProbeStart()
Definition AndroidPlatformMemory.cpp:724
static CORE_API FPlatformMemoryStats GetStats()
Definition AndroidPlatformMemory.cpp:204
static CORE_API void Init()
Definition AndroidPlatformMemory.cpp:78
static CORE_API void UpdateOSMemoryStatus(EOSMemoryStatusCategory OSMemoryStatusCategory, int value)
Definition AndroidPlatformMemory.cpp:401
ETrimValues
Definition AndroidPlatformMemory.h:91
static void AndroidMemoryProbeTick()
Definition AndroidPlatformMemory.cpp:772
static CORE_API bool GetLLMAllocFunctions(void *(*&OutAllocFunction)(size_t), void(*&OutFreeFunction)(void *, size_t), int32 &OutAlignment)
Definition AndroidPlatformMemory.cpp:698
static CORE_API void BinnedFreeToOS(void *Ptr, SIZE_T Size)
Definition AndroidPlatformMemory.cpp:578
static CORE_API uint64 GetMemoryUsedFast()
Definition AndroidPlatformMemory.cpp:353
static CORE_API const FPlatformMemoryConstants & GetConstants()
Definition AndroidPlatformMemory.cpp:415
Definition GenericPlatformMemory.h:87
Definition GenericPlatformMemory.h:133
EMemoryPressureStatus
Definition GenericPlatformMemory.h:155
Definition GenericPlatformMemory.h:225
Definition AndroidPlatformMemory.h:15
uint64 VMSwap
Definition AndroidPlatformMemory.h:17
FGenericPlatformMemoryStats::EMemoryPressureStatus GetMemoryPressureStatus() const
Definition AndroidPlatformMemory.cpp:327
uint64 RssFile
Definition AndroidPlatformMemory.h:19
uint64 VMRss
Definition AndroidPlatformMemory.h:18