The author investigated a mysterious memory usage pattern in their Rust service, which would exhibit a "stair-step" profile with sharp increases in memory usage under load. The issue was found to be caused by heap fragmentation, a problem where the allocator adds and removes values of varying sizes over time, leading to gaps in the heap that cause new blocks of memory to be allocated to accommodate larger values. To mitigate this issue, the author switched to using jemalloc, an allocator that goes out of its way to avoid fragmentation, resulting in a more stable memory profile with less "lost" memory. The change had a positive impact on the service's performance and responsiveness under load.