Add Program Size Memory access and log on start

This commit is contained in:
Wojtek Figat
2025-03-05 12:10:17 +01:00
parent 7809007a13
commit 06729f6b62
5 changed files with 41 additions and 30 deletions

View File

@@ -283,6 +283,7 @@ namespace
bool IsPaused = true;
bool IsVibrating = false;
int32 ScreenWidth = 0, ScreenHeight = 0;
uint64 ProgramSizeMemory = 0;
Guid DeviceId;
String AppPackageName, DeviceManufacturer, DeviceModel, DeviceBuildNumber;
String SystemVersion, SystemLanguage, CacheDir, ExecutablePath;
@@ -724,6 +725,7 @@ MemoryStats AndroidPlatform::GetMemoryStats()
result.UsedPhysicalMemory = (totalPages - availablePages) * pageSize;
result.TotalVirtualMemory = result.TotalPhysicalMemory;
result.UsedVirtualMemory = result.UsedPhysicalMemory;
result.ProgramSizeMemory = ProgramSizeMemory;
return result;
}
@@ -826,6 +828,9 @@ bool AndroidPlatform::Init()
ClockSource = CLOCK_MONOTONIC;
}
// Estimate program size by checking physical memory usage on start
ProgramSizeMemory = Platform::GetProcessMemoryStats().UsedPhysicalMemory;
// Set info about the CPU
cpu_set_t cpus;
CPU_ZERO(&cpus);