From 60d776cdacb37fc4c94f6d65945d50bebc9b0f87 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 20 Aug 2023 19:04:40 +0200 Subject: [PATCH] vulkan/malloc: bump up maximum slab age Helps avoid GC/realloc thrashing on high FPS displays, especially with the fact that mpv now calls *both* pl_gpu_flush() and pl_swapchain_submit(), leading to two GC age ticks per frame. Probably a more principled solution would be better (e.g. wallclock age), but for now this is a quick improvement to the status quo. --- src/vulkan/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/malloc.c b/src/vulkan/malloc.c index 7cfa75b5..f6674e0c 100644 --- a/src/vulkan/malloc.c +++ b/src/vulkan/malloc.c @@ -49,7 +49,7 @@ // How long to wait before garbage collecting empty slabs. Slabs older than // this many invocations of `vk_malloc_garbage_collect` will be released. -#define MAXIMUM_SLAB_AGE 8 +#define MAXIMUM_SLAB_AGE 32 // A single slab represents a contiguous region of allocated memory. Actual // allocations are served as pages of this. Slabs are organized into pools,