From 196ada571043c80731f093ad08b7c7abf8dab140 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 5 Mar 2025 13:43:15 +0100 Subject: [PATCH] Add Extra Development Memory access and log on start --- Source/Engine/Platform/Base/PlatformBase.cpp | 3 +++ Source/Engine/Platform/GDK/GDKPlatform.cpp | 1 - Source/Engine/Platform/MemoryStats.h | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Platform/Base/PlatformBase.cpp b/Source/Engine/Platform/Base/PlatformBase.cpp index 40c017c6e..c8de3c6cf 100644 --- a/Source/Engine/Platform/Base/PlatformBase.cpp +++ b/Source/Engine/Platform/Base/PlatformBase.cpp @@ -175,6 +175,9 @@ void PlatformBase::LogInfo() LOG(Info, "Physical Memory: {0} total, {1} used ({2}%)", Utilities::BytesToText(memStats.TotalPhysicalMemory), Utilities::BytesToText(memStats.UsedPhysicalMemory), Utilities::RoundTo2DecimalPlaces((float)memStats.UsedPhysicalMemory * 100.0f / (float)memStats.TotalPhysicalMemory)); LOG(Info, "Virtual Memory: {0} total, {1} used ({2}%)", Utilities::BytesToText(memStats.TotalVirtualMemory), Utilities::BytesToText(memStats.UsedVirtualMemory), Utilities::RoundTo2DecimalPlaces((float)memStats.UsedVirtualMemory * 100.0f / (float)memStats.TotalVirtualMemory)); LOG(Info, "Program Size: {0}", Utilities::BytesToText(memStats.ProgramSizeMemory)); +#if !BUILD_RELEASE && !PLATFORM_DESKTOP + LOG(Info, "Extra Development Memory: {0}", Utilities::BytesToText(memStats.ExtraDevelopmentMemory)); +#endif LOG(Info, "Main thread id: 0x{0:x}, Process id: {1}", Globals::MainThreadID, Platform::GetCurrentProcessId()); LOG(Info, "Desktop size: {0}", Platform::GetDesktopSize()); diff --git a/Source/Engine/Platform/GDK/GDKPlatform.cpp b/Source/Engine/Platform/GDK/GDKPlatform.cpp index 8d3bd935d..fe58c8c98 100644 --- a/Source/Engine/Platform/GDK/GDKPlatform.cpp +++ b/Source/Engine/Platform/GDK/GDKPlatform.cpp @@ -6,7 +6,6 @@ #include "Engine/Platform/Window.h" #include "Engine/Platform/CreateWindowSettings.h" #include "Engine/Platform/WindowsManager.h" -#include "Engine/Platform/MemoryStats.h" #include "Engine/Platform/BatteryInfo.h" #include "Engine/Platform/Base/PlatformUtils.h" #include "Engine/Profiler/ProfilerCPU.h" diff --git a/Source/Engine/Platform/MemoryStats.h b/Source/Engine/Platform/MemoryStats.h index 75788d5db..ab2fb1b91 100644 --- a/Source/Engine/Platform/MemoryStats.h +++ b/Source/Engine/Platform/MemoryStats.h @@ -35,6 +35,11 @@ API_STRUCT(NoDefault) struct MemoryStats /// Amount of memory used initially by the program data (executable code, exclusive shared libraries and global static data sections). /// API_FIELD() uint64 ProgramSizeMemory = 0; + + /// + /// Amount of extra memory assigned by the platform for development. Only used on platforms with fixed memory and no paging. + /// + API_FIELD() uint64 ExtraDevelopmentMemory = 0; }; ///