mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #441] [MERGED] runtime: honor LEONIDA_TITLE_MEMORY_MB in XSystemGetAppMemoryUsageLimit and XMemGetWorkingSetStatistics (RT-TITLE-MEMORY-CAP) #491
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#491
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/441
Author: @jujumoneylol
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:pr/title-memory-cap📝 Commits (2)
6c1d939runtime: honor LEONIDA_TITLE_MEMORY_MB in XSystemGetAppMemoryUsageLimit and XMemGetWorkingSetStatistics6cb16a4docs: document LEONIDA_TITLE_MEMORY_MB in runtime/README.md📊 Changes
5 files changed (+93 additions, -2 deletions)
View changed files
📝
runtime/README.md(+2 -1)📝
runtime/shims/xgameruntime.cpp(+16 -1)📝
runtime/shims/xmem.cpp(+15 -0)📝
runtime/test/xgameruntime_test.cpp(+31 -0)📝
runtime/test/xmem_test.cpp(+29 -0)📄 Description
Claimed in the coordination issue as: RT-TITLE-MEMORY-CAP (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7122816234)
What and why
Implements @KoLolX3's finding in #14: both
XSystemGetAppMemoryUsageLimit(runtime/shims/xgameruntime.cpp) andXMemGetWorkingSetStatistics(runtime/shims/xmem.cpp) previously always reported total host physical RAM (ullTotalPhys), causing memory-constrained hosts (16 GB systems or cgroup-capped runs) to tell the title it has more memory than it can safely allocate.LEONIDA_TITLE_MEMORY_MBin bothXSystemGetAppMemoryUsageLimit()andXMemGetWorkingSetStatistics()(total memory at+0).2048..65536MiB (2 GiB..64 GiB).GlobalMemoryStatusEx().ullTotalPhys/ 12 GiB fallback unchanged).6144), lower/upper clamping (512→2048,131072→65536), and malformed values inruntime/test/xgameruntime_test.cppandruntime/test/xmem_test.cpp.Tested
xgameruntime_testandxmem_testwith MSVC 19.44 (vcvars64) + Ninja on top ofmain8f481cf16.xgameruntime_test: OK (166 checks).xmem_test: OK (222 checks).py -3.13 -I scripts/check_no_game_data.py runtime/shims/xgameruntime.cpp runtime/shims/xmem.cpp runtime/test/xgameruntime_test.cpp runtime/test/xmem_test.cpp: clean.GPUs tested: n/a (CPU-only runtime shim & unit tests on Windows 11 26200)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — runtime shim only)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.