✅ Growing memory issues for ASP.NET Core App

I'm using JetBrians Rider's memory profiler. I found that my application memory growing significantly. The app pretty much pulls stock market's candlestick data, cache it via MemoryCache with SlidingExpiration of 10 minute and AbsoluteExpiration of 1 hour. That's pretty much where I think most of the memory goes to.

From the profiling image below, I found that the heap generation is taking lots of space. I searched onlline and found that I should call GC.Collect() to retain memory. But this stackoverflow post says otherwise.

What can I do to improve the memory usage of my application? What kind of things do I need to look for in order to make it consume less memory?
image.png
Stack Overflow
Although I do understand the serious implications of playing with this function (or at least that's what I think), I fail to see why it's becoming one of these things that respectable programmers w...
Was this page helpful?