I have an application that has a search function. This function scans a search query in a giant object (dictionary), which I cache for 24 hours. The object is about 50,000 keys and weighs about 10 MB.
When I look at the memory usage on my hosting, I notice that after a few requests, the memory usage goes from 50 MB to more than 450 MB, forcing my hosting provider to kill the application.
So I wonder what is going on here. In particular, how does the cache use memory for each request, and what can I do to fix this?
source share