Allocation failures: system RAM exhaustion retries, then drops -- never crash #698

Closed
opened 2026-10-12 06:11:42 +00:00 by sky_line · 1 comment
Owner

Policy (owner, 2026-10-12): a failed allocation is never a crash. Default: keep what we have, retry the request a few frames later (space may free up), then drop that asset/request and log the failure (rate-limited, with what failed, size, and the current RAM/VRAM pressure state). Better a missing texture/mesh than a dead viewer -- and when someone says "things aren't loading", the log tells us it's memory pressure.

Scope (system memory)

  • std::bad_alloc in decode/worker jobs (textures, meshes, VK store fill thread, image decode): skip the job, requeue with backoff, give up and log after N tries.
  • LLVolume out-of-memory LL_ERRS paths become failure returns; the mesh repository's outOfMemorySoftQuit() calls become per-mesh failures (retry later, then drop).
  • Unguarded worker threads get exception guards.
  • An emergency reserve block freed on the first allocation failure, plus a RAM-pressure step that sheds caches (retained CPU texture copies first, see #636).
  • Main-thread bad_alloc handled at the frame boundary where feasible.
**Policy (owner, 2026-10-12):** a failed allocation is never a crash. Default: keep what we have, retry the request a few frames later (space may free up), then drop that asset/request and log the failure (rate-limited, with what failed, size, and the current RAM/VRAM pressure state). Better a missing texture/mesh than a dead viewer -- and when someone says "things aren't loading", the log tells us it's memory pressure. **Scope (system memory)** - `std::bad_alloc` in decode/worker jobs (textures, meshes, VK store fill thread, image decode): skip the job, requeue with backoff, give up and log after N tries. - `LLVolume` out-of-memory `LL_ERRS` paths become failure returns; the mesh repository's `outOfMemorySoftQuit()` calls become per-mesh failures (retry later, then drop). - Unguarded worker threads get exception guards. - An emergency reserve block freed on the first allocation failure, plus a RAM-pressure step that sheds caches (retained CPU texture copies first, see #636). - Main-thread `bad_alloc` handled at the frame boundary where feasible.
sky_line added this to the Slipstream project 2026-10-12 06:11:42 +00:00
Author
Owner

Shipped in 1.3.0 Beta 7 (fdfaf0bcb8 RAM allocation failures are never a crash -- retry / drop / shed; 9e60d02afe decode OOM handling). Closing -- reopen or comment if you still see this.

Shipped in 1.3.0 Beta 7 (fdfaf0bcb8 RAM allocation failures are never a crash -- retry / drop / shed; 9e60d02afe decode OOM handling). Closing -- reopen or comment if you still see this.
sky_line 2026-10-14 06:33:43 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#698
No description provided.