Memory leaks can be a nightmare, especially in high-traffic production apps. Ben Sheldon shared his experience debugging a memory increase in a decade-old Rails app. After suspecting telemetry changes, the team used rbtrace to dump Ruby’s memory heap and sheap to analyze it. They discovered an Array holding references to over 32,000 Event objects, causing a memory leak. By spelunking through these objects using sheap, they identified the root cause – improperly stored redirect events. This unique approach showcases the intricate detective work required to hunt down elusive memory leaks in complex web applications.
https://stevenharman.net/so-we-have-a-memory-leak