CLR out Of Memory Exceptions

2019-04-07 16:59发布

We are getting a lot of out of memory exceptions and we cant seem to diagnose what is happening. It seems to be an issue that happens that will spike memory usage from 300 megs to over a Gig in a mater of a few Min. Now this is an IIS app and has 3 app domains running in separate thread pools.

We want to record when the Memory exceptions are about to happen. So we can attempt to find a pattern. My question is: What is the best way to do this? Is there a way to Query the Memory usage once a min to see how high it is and send an alert email. Or maybe write an app that will monitor the CLR's memory usage? an ideas or a direction are more then welcome.

EDIT

I am using Perfmon but unless I am watching the process it is not that useful. I can only see what is was and when. I have also used the Red Gate Memory Profile tool, which is awesome by the way, only I cannot seem to hit apon the page or process that is causing the exception.

7条回答
Evening l夕情丶
2楼-- · 2019-04-07 17:55

Use dotTrace or YourToolkit .Net where you can attach the profiler to the ASP process, they have trial version so you don't need to spend money right away. Using these profilers you can select the time line where memory starts increasing (you can see the memory usage visually in a graph) so it should be quite easy to select the range and understand what is causing the memory usage to shoot up so high.

查看更多
登录 后发表回答