RAM: 16.7 GB of CPU texture copies kept after GPU upload #159

Closed
opened 2026-09-29 05:49:02 +00:00 by sky_line · 2 comments
Owner

Users report excessive RAM use. A busy two-sim view (2026-09-29, ~45 avatars) measured 28.3 GB RSS (26.2 GB anonymous). The viewer's own accounting (VKMem log line, [cpu tex ...]):

cpu tex 16742MB 22839 copies

That's LLImageGL::sVKCpuBytes: pixel copies retained so the Vulkan path can (re)upload textures. It's more than half the process, while the GPU holds only 3.4 GB of textures at the residency it actually uses.

Direction (standard engine practice)

  • Once a texture's resident GPU image is uploaded, drop the CPU pixel copy.
  • When a sharper mip is needed later (residency upgrade) or the image must be rebuilt (eviction / device loss), re-decode from the local texture cache. The J2C bytes are already on disk; LL's decode pipeline can produce any discard level.
  • Keep a CPU copy only while an upload is pending, and for images that need CPU access: media, UI / local bitmaps, the eyedropper, anything reading pixels back.
  • Bound whatever remains with a budget (LRU of CPU copies, e.g. RenderVKCpuTexBudgetMB), rather than retaining every texture ever decoded.

Check

  • cpu tex in the VKMem line should fall from 16.7 GB to a small working set; RSS should drop by roughly the same.
  • Residency upgrades / downgrades still work (no stuck-blurry textures, no magenta): they now wait on a re-decode instead of a memcpy, so measure upgrade latency.
  • Local textures (#109 / Local Assets) and media keep working.

Refs #157 (perf/memory audit).

Users report excessive RAM use. A busy two-sim view (2026-09-29, ~45 avatars) measured **28.3 GB RSS** (26.2 GB anonymous). The viewer's own accounting (`VKMem` log line, `[cpu tex ...]`): ``` cpu tex 16742MB 22839 copies ``` That's `LLImageGL::sVKCpuBytes`: pixel copies retained so the Vulkan path can (re)upload textures. It's more than half the process, while the GPU holds only 3.4 GB of textures at the residency it actually uses. ## Direction (standard engine practice) - Once a texture's resident GPU image is uploaded, **drop the CPU pixel copy**. - When a sharper mip is needed later (residency upgrade) or the image must be rebuilt (eviction / device loss), **re-decode from the local texture cache**. The J2C bytes are already on disk; LL's decode pipeline can produce any discard level. - Keep a CPU copy only while an upload is pending, and for images that need CPU access: media, UI / local bitmaps, the eyedropper, anything reading pixels back. - Bound whatever remains with a budget (LRU of CPU copies, e.g. `RenderVKCpuTexBudgetMB`), rather than retaining every texture ever decoded. ## Check - `cpu tex` in the VKMem line should fall from 16.7 GB to a small working set; RSS should drop by roughly the same. - Residency upgrades / downgrades still work (no stuck-blurry textures, no magenta): they now wait on a re-decode instead of a memcpy, so measure upgrade latency. - Local textures (#109 / Local Assets) and media keep working. Refs #157 (perf/memory audit).
Author
Owner

Part of #405 (RAM/VRAM management epic).

Part of #405 (RAM/VRAM management epic).
sky_line added this to the Slipstream project 2026-10-06 15:04:15 +00:00
Author
Owner

Ticket audit 2026-10-07: done and shipped in 1.0.0 Beta 10. CPU texture copies cut to thumbnails after upload, governor-trimmed, tiered, and served from the GPU-ready disk cache (475bfa8d4f, 0e64a5c9c1, d18a2f978f, 3b69be27c5, 2e46bbcecd). If you still see the problem on the current beta, please reopen or file a new report.

Ticket audit 2026-10-07: done and shipped in **1.0.0 Beta 10**. CPU texture copies cut to thumbnails after upload, governor-trimmed, tiered, and served from the GPU-ready disk cache (475bfa8d4f, 0e64a5c9c1, d18a2f978f, 3b69be27c5, 2e46bbcecd). If you still see the problem on the current beta, please reopen or file a new report.
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.

Reference
sky_line/Slipstream#159
No description provided.