I have a c# program that visits web wanders around a website using IE (via shdocvw.dll). It runs fine for a while but after running for a while (an hour or two) it throws an OutOfMemoryException. This is a legitimate exception because my app is taking up a ton of memory. My question is how do i find out where all my memory is being taken up (just looking at my code i dont see anything that should be taking up that much memory, the call stack is not deep, i don't see anything that would build up over time).
It seems to me that the Visual Studio developers would have thought of this situation and provided a tool that shows you what is going on with memory in your program (like how big each variable is) but I cannot find this tool. If it is not part of Visual Studio (i am using version 2008) then is there a third party app that does this? If it is in VS then how can i get to it?