Repository navigation
Vulkan: release command buffer memory at each begin on Arm's driver (memory leak) - #607
Merged
Merged
Conversation
libmali keeps the memory vkCmdBeginRendering allocates across the implicit reset of vkBeginCommandBuffer, so the process grew by ~490 MB an hour. Reset with RELEASE_RESOURCES before each begin on VK_DRIVER_ID_ARM_PROPRIETARY; LARECOMP_VK_CB_RELEASE=0/1 overrides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks, merged into beta_6 in 0c36111. On Arm's driver the command buffers now give their memory back at each begin, so the game no longer grows until it runs out; it goes live with the next release. |
peiikai
added a commit
that referenced
this pull request
Nov 7, 2026
README: credit wolfchimneyrock for #607
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Arm's own Vulkan driver (libmali) the game's memory grows by about 490 MB an hour, until it runs out of memory after a few hours (sooner on 4 GB boards). PanVK and Turnip don't grow.
Cause. A malloc tracker on the running game put every growing allocation inside libmali: 64 KB host-memory blocks allocated by
vkCmdBeginRendering(about 95% frombegin_pass, the rest fromvk_frame_begin). The command buffers are reused through the implicit reset ofvkBeginCommandBuffer(pool flagRESET_COMMAND_BUFFER), and libmali keeps those blocks across that reset.Change. Before each begin,
begin_cb_runresets the command buffer withVK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT. On by default forVK_DRIVER_ID_ARM_PROPRIETARYonly;LARECOMP_VK_CB_RELEASE=0/1overrides, logged at start like the other per-GPU defaults; a row in docs/vulkan-gpu-defaults.md.Tested (Vulkan backend only; nothing changes on Metal): Linux, RK3588 (Mali-G610), libmali g29p1, 720p, the Field east of Marin and Tarin's house, 7-minute runs, warm shader cache:
LARECOMP_VK_CB_RELEASE=0The same change on an earlier build held flat for 7 minutes too. PanVK (Mesa main) and Turnip were already flat and keep the old path.
🤖 Generated with Claude Code