© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
29 replies
reinaldyrfl

✅ 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
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()
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
What's so wrong about using GC.Collect()?
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...
What's so wrong about using GC.Collect()?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

lib for asp.net core dependency issues
C#CC# / help
16mo ago
✅ ASP.NET CORE with React.js or ASP.NET CORE WEB APP
C#CC# / help
3y ago
❔ ASP.NET Core web app vs ASP.net web application(.NET Framework)
C#CC# / help
4y ago