Return pipeline-compile memory to the OS after each compile batch (OOM on 16 GB after first launch) #1103
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream#1103
Loading…
Add table
Add a link
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?
Pipeline compile memory is not returned to the OS after a compile batch.
Seen in #1059 (Intel Arc B580, Mesa 26.2.5, 16 GB RAM + zram): first launch after an update discards the pipeline cache, so the viewer cold-compiles ~200 pipelines on up to 15 threads (~500 s of compile time). The session then sits at 8.6-9.9 GB resident (vs ~4 GB on a larger scene on the owner's NVIDIA box with a warm cache), swaps heavily into zram, and is OOM-killed after ~6 minutes. The reporter cannot reproduce it on later launches (warm cache). The memory is freed but retained by the allocator: glibc keeps per-thread arenas, and the driver compiler allocates heavily on every compile thread.
Fix:
malloc_trim(0)when a batch completes (Linux/glibc; no-op elsewhere).mallopt(M_ARENA_MAX, ...)or an equivalent per-thread policy), so 15 compile threads cannot spread memory over 15 arenas.Verify: cold-cache start (delete
vk_pipeline_cache.bin+vk_spec_*.bin) vs warm start; resident memory after the batch should drop to the warm-start level.