We had an image conversion script running on .NET 4.0, IIS 7, ASP.NET, 4 GB of server RAM, which resizes large images and therefore requires a lot of memory.
The first script increased memory usage by almost 100%, leaving almost nothing for SQL Server, which also worked (which left memory up to 20 MB instead of the usual 900 MB).
In the second script, we added GC.Collect () and (probably) a sleeping thread in one cycle after each cycle, and everything returned to normal.
Question: Isn't that a mistake in .NET memory management? Shouldn't the system look more closely at what is happening with available memory, slow down and clean up?
source
share