The bug
Since 26.4 Snapshot 6, the Vulkan backend allocates the clear values for every render pass on the native heap and never frees them. Native memory use grows for as long as the game renders, both on the title screen and in a world. 26.4 Snapshot 5 doesn't leak.
In a new world, each frame leaks about 80 bytes: 32 for the main level pass, 32 for the first-person hand pass and 16 for the GUI. Texture animation and lightmap updates leak about 2.4 KB more per second. At 60 FPS that is about 26 MB per hour, and higher frame rates leak more.
Steps to reproduce
In the launcher, add these JVM arguments to a 26.4 Snapshot 6 installation:
-Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugAllocator=trueLaunch the game with Graphics API set to Default or Vulkan. The log should say "Using graphics backend Vulkan".
Wait on the title screen for one minute.
Click Quit Game.
Read the game output: LWJGL lists leaked allocations as the game exits.
Observed result
LWJGL reports thousands of leaked 16- and 32-byte allocations, all made by VkClearValue.calloc in VulkanCommandEncoder.createRenderPass. 55 seconds on the title screen leaked 13,204 (211 KB). Loading a new world and playing for 80 seconds leaked 34,573 (783 KB).
Expected result
Nothing allocated by VulkanCommandEncoder.createRenderPass leaks. The same test on 26.4 Snapshot 5 reports no leaks from render passes.
Code analysis
VulkanCommandEncoder.createRenderPass(RenderPassDescriptor) creates its clear-value buffer with VkClearValue.calloc(count). That allocates on the native heap and must be freed explicitly, and nothing frees it. In 26.4 Snapshot 5 the buffer came from VkClearValue.calloc(count, stack), on the MemoryStack the method already pushes, which frees it when the method returns. Allocating it on that stack again fixes the leak.
Additional notes
Reproduced in an unmodified game, on the title screen and in a new world with default settings.
The attached file lists the leaks by the code that began each render pass, with one stack trace each, for both snapshots.
Environment
Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4070 Ti, driver 621.01 (Vulkan 1.4.357), Java 25.0.3
Thank you for helping us improve Minecraft! We saved your files: