We had an image conversion script running on .NET 4.0, IIS 7, ASP.NET, 4 GB server RAM that resizes large images and thus needs a lot of memory.
The first script increased memory usage to almost 100%, leaving virtually nothing for the SQL Server that was also running (which gave up memory until running on 20 MB instead the usual 900 MB).
In the second script we added a GC.Collect() and (to be sure) a one sec thread sleep after each cycle, and everything went back to normal.
Question: isn’t that a flaw in the .NET memory management? Shouldn’t the system take a closer look at what’s happening with the available memory, slow things down and clean up?
According to the docs:
I assume this situation hasn’t been satisfied as SQL Server is backing down instead. As for it being a bug; the docs would suggest this is by design.