[performance][memory] Parked texture blocks keep 1.7 GB free in PC memory, and neither DARNER_POOL_TRIM nor DARNER_TEX_COMPACT reaches them #375
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?
What you see
At the end of a 41-minute open-world run on a 12 GB card, the texture park holds 54 blocks of 64 MB in the PC's memory (3,456 MB). Of that, 1,707 MB is free inside blocks that still hold some textures. The card ledger line is "parked texture blocks: 54 holding 3456 MB (1739 live, 1707 free, 10 resting)".
I posted the whole shared-memory split in the "PC memory use is still high" known-issue thread (#197, issuecomment-868521). This issue is about one part of it that needs a code change rather than more reports.
From reading the code at
f3840d73(not measured):pool.rs:81-90), so empty blocks do go back. The 1.7 GB is free space inside blocks that still hold textures.DARNER_POOL_TRIMacts on the card's texture blocks and on staging and buffers (pool.rs:60-73,:91-94), not on the parked pools.DARNER_TEX_COMPACT(best fit) applies to pools made withPool::textures(TEXTURESandSMALL,pool.rs:955-958). The parked pools are made withPool::with_budget(:1409-1412), which always cuts from the fullest block.In one local run with
DARNER_POOL_TRIM=1(same PC and build, route not the same as the baseline), shared memory was no lower than the baseline. The texture re-upload warnings went from 6.9 to 10.7 a minute (86 in 12 minutes against 79 in 7). A few textures showed white in that run; I didn't check whether they also show without the switch.Possible directions, none of them tried:
DARNER_PAGE_DRAIN) does for page-buffer heaps.Before you post
RAY TRACING in F1
Off
GPU and driver
RTX 4070 Ti 12 GB, driver 621.01
CPU, RAM and Windows version
i7-14700K, 32 GB, Windows 11 (build 26300)
Darner release or commit
v2026.12.03.02
Settings
Series X, 1080p to 1440p, DLSS Quality, DLSS frame generation 2x, ray tracing off, texture quality high. Started from the play launcher with its defaults, including
DARNER_TEX_PARK=1. The full switches line is at the top of the log.Log files attached
darner-play-20261204-093959-22072.log(baseline) anddarner-play-20261204-152748-8256.log(DARNER_POOL_TRIM=1) are not attached (52 MB and 12 MB). I can share redacted copies.Are you working on a fix?
No
Since #332 is cited: two things from the rig it was measured on, and one from the code.
The same ledger line at the end of six 12 min drives today (RTX 5070 12 GB, Series S profile, DLSS Quality, no ray tracing, main
f3840d73,DARNER_TEX_PARK=1, one route): the park peaks at 2 to 5 blocks and ends at 1 to 4, almost empty: "3 holding 192 MB (11 live, 181 free)", "1 holding 64 MB (1 live, 63 free)", "4 holding 256 MB (15 live, 241 free)". So the same shape as yours (blocks kept for a few MB of textures), far smaller here; I have no Series X or 41 min run to compare.On doing what #332 does: its drain moves tiles of reserved buffers, which
UpdateTileMappingspoints at another heap while the resource and everything that refers to it stay. From readingpool.rsatf3840d73(not tried), parked textures are placed resources (CreatePlacedResource), so emptying a sparse block means making the texture again in another block, copying it, and switching whatever holds the old one. What carries over is the rule: the emptiest block, only when the others have room for what it holds, one at a time, a rest after each.One finding that may matter for the order of work: in our drives the drain alone gave no private-memory gain; it paid only once #319 gave memory back inside the heaps first. Here the free space is already there (1,707 MB), so that part may not apply.
We are working on memory on our side and will go on with it as soon as the current PRs (#319, #332) are dealt with. Our view is that memory is a real problem here, and that it needs to be treated in depth rather than switch by switch.
Nothing of this was tried on the park.
There is already a switch aimed at this case:
DARNER_PARK_COMPACT_WASTE=1. It is off by default and marked "under test" in the README table. It is in v2026.12.03.02, the release you name. Your reading ofDARNER_POOL_TRIMandDARNER_TEX_COMPACTlooks right to me: neither one is what reaches the parked blocks.What the switch does: when the parked blocks in PC memory have 1 GB or more free, and the free part is at least a third of what the blocks hold, the idle parked textures in them are let go, and emptied blocks give their shared memory back. Only blocks less than about a third full are emptied, so how much comes back depends on how many of your 54 blocks are that sparse. A texture that was let go is made again the next time it is used. It runs inside the existing texture compaction (
DARNER_COMPACT_SPARSE, on unless set to0), and it works even when the PC has plenty of room. Without the switch, that compaction only touches the parked blocks when the PC is short of commit, short of shared room, under memory pressure, or low on host room, which I would not expect on 32 GB, but have not checked.Your ledger line meets the trigger: 1,707 MB free is more than 1,024 MB, and 1,707 x 3 is more than 3,456 MB.
We have not run this ourselves, so I can't say how much it gives back on your run. Could you try one run with
DARNER_PARK_COMPACT_WASTE=1on the same build and report:The thing to watch is the re-upload rate. Your
DARNER_POOL_TRIM=1run went from 6.9 to 10.7 warnings a minute with a few white textures (and, as you noted, you did not check without the switch). If this switch does the same, that is worth knowing. If you can, a run with and without it on the same route would tell the two apart.Details for the maintainer
README.md:744(tag v2026.12.03.02): theDARNER_PARK_COMPACT_WASTErow.crates/darner-gpu/src/resource.rsat v2026.12.03.02:compact_plan(about line 5341) setspark_wastewhenpark_holesholds and the switch is on;park_wasteful(about line 5385) isfree >= PARK_WASTE && free * 3 >= held;PARK_WASTEis 1 GiB;park_holesneeds 512 MB or more free in the parked pools (COMPACT_HOLES).do_parkempties only blocks under 35% held (COMPACT_SPARSE_PER_MILLE350, viasparse_parked_blocks,pool.rsabout line 2365); your average is about 50% (1,739 of 3,456 MB live).do_parkneedsshort_of_commit || park_tight.This post was written with AI assistance (Claude Code).
Thanks, both of you.
@Jesper-A: I missed
DARNER_PARK_COMPACT_WASTE. I checked it atf3840d73(resource.rs:5341-5392) and read it the same way. In the 41-minute baseline, the trigger (1 GB or more free, and at least a third of the blocks free) was first met about 28 minutes in, and held most of the time after about 35 minutes. So each test run needs about 40 minutes of open-world play.Planned, not run yet: two runs of about 40 minutes on the same route, one without
DARNER_PARK_COMPACT_WASTE=1and one with it. For each, I'll post here:I'm on other runs first, so this will take a while.
@Cyber-Croissant: thanks for the numbers and the note on placed resources. Understood: #332's drain doesn't carry over to the park as it is, only its rule (the emptiest block, one at a time, when the others have room).
This post was written with AI assistance (Claude Code).