I'm finishing up a project, but there seem to be something which is using too much memory. I think there's something that isn't being disposed. And since my program has a LOT of code, I don't feel like going through everything.. There must be a way to see what variable is using what amount of memory during runtime?
You can look at the managed memory using a debugger such as WinDbg with the SOS extension.
Attach to your process, load SOS using the .loadby sos clr command and inspect the heap using the !dumpheap -stat command. That will tell you the number and type of objects on the heap. From there you can figure out if any of these are taking up more memory than you expected.
This question has relevant information as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With