Reputation: 10330
I am developing a WinForm application. When running it for a long time wihout stopping, it suddenly raise a OutOfMemoryException. I don't know how to find the reason which causes this exception. I use Task Manager to see how much memory my application to use, I see that it only take 90000 KB while my RAM is 2GB. I don't know it is a memory leak error? If yes, I remember there are some .NET tools to help finding the memory leak.
Please help me. Thanks.
Upvotes: 3
Views: 1595
Reputation: 222
A useful tool to see how much and what kind memory your process is using.
Provides a graphical view of the heap and what is holding on to what. It can be a bit slow, but if the leak is in the managed heap it will point out what types are the problem pretty easily. Here's a guide.
Like parapura mentioned, this is will let you find your leak, but there's a steep learning curve (and almost no gui).
Upvotes: 1
Reputation: 24403
If you run your application through WinDbg you will be able to get a break down of all the objects in memory. A unusually large number will pin point the exact object that is causing this behavior.
You can follow these instructions
In a nut shell you do
Upvotes: 4