Get the latest tech news
Mimalloc Cigarette: Losing one week of my life catching a memory leak (Rust)
One of applications at my work has always been RAM-bound - it's a pricing engine that basically loads tons of hotels, builds some in-memory indices and then allows you to issue queries like find me the cheapest hotel in berlin, pronto. A pricing engine's main purpose is to price engines hotels, but in order to do that effectively, there's a lot of "meta work" involved, like: - Where do we load the data from, how do we do it? - Do we load the entire dataset or just some parts of it? - Should we precalculate prices in order to speed-up the most popular queries? Such an engine poses an interesting technical challenge, even greater so when one day it starts OOMing on production, even though the entire dataset should fit in the memory multiple times...
Such an engine poses an interesting technical challenge, even greater so when one day it starts OOMing on production, even though the entire dataset should fit in the memory multiple times... Of course IRL there's ArcSwap instead of RwLock, every hotel contains much more information (like taxes, discounts or supplements) etc., but we've got a reasonably good approximation here. Getting to this point already took three days of my life - believe me or not, when faced with 200k lines of Arc-ridden Rust code that seems to generate a memory leak, one's first thought is not "let's try with different allocator", but rather "probably something's holding onto an Arc for too long".
Or read this on Hacker News