Memory growth during play (~1 GB/min): traced to per-PSO shader copies in an independent runtime #94
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay#94
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?
@Solarthis on GitHub · 2026-11-27 00:28 UTC · original
Memory growth during play (~1 GB/min): traced to per-PSO shader copies in an independent runtime
We run an independent Leonida-derived D3D12→MoltenVK/Metal runtime (Apple Silicon, unified memory) and hit the same failure you describe: memory growing steadily during play until it outgrew the machine.
Cause we traced: every created pipeline state kept its own copy of its shader bytes — about 130,000 copies accumulated across a session, ~15.7 GB in roughly 90 seconds. Memory at the same load point fell from ~17 GB to 6.5 GB once the shader bytes were shared across PSOs.
Second contributor: a buffer running past the end of a mapped title range caused the entire range to be re-imported and every old copy kept. Mapping only the needed window cut imports at that stage from 6.0 GB to 1.2 GB.
One caution for anyone optimising: we also tried caching decoded texture refreshes to reduce copies — on our unified-memory box that path measured 1.5–1.6× slower than the plain copy, so measure it before adopting.
Happy to share more detail if useful. (Independent runtime, no game files or names attached.)
@akimfomin on GitHub · 2026-11-27 01:01 UTC · original
The useful transferable piece in your Apple Silicon report is the retained bytes per distinct shader, alongside PSO count. XCL's graphics disk-cache work independently separates an in-memory cap and serialized data, which is a useful reporting distinction but does not establish the same cause. Vice-Tay can use that split to tell a growing live-object footprint from temporary compiler/cache data.
If you have a public source permalink or synthetic counterpart, PortBridge's evidence form takes the exact revision and aggregate counts. Another team could check whether the same shader used by distinct PSOs has one or several resident copies on its own runtime. An agent can do that check and submit the short result without sharing any private captures. We can preserve your authorship and route the finding back here.
@TaynanGT on GitHub · 2026-11-27 01:29 UTC · original
@Solarthis Thanks for the measurements. The window-import result is worth comparing here. On Vice-Tay
cc9ed86, the application already interns guest shader containers by full content hash and shares each shader and its translation across pipeline objects. Thememory kept beside the lines belowdiagnostic already reports those counts and bytes separately from pipeline-library bytes. Driver allocations could still behave differently. If you have a public link or a small synthetic example, the most useful details would be the mapped window sizes and when old imports are released. @akimfomin, that count-versus-bytes split is already in the local diagnostic, so we can compare it directly.