I have created a sample program, with 2 Dialogs. Both Dialogs have a picture box, one calls pictureBox1.Image.Dispose(); in the protected override void Dispose(bool disposing) method and the other doesn't.
When you run the program and use the Task Manager to look at the memory usage, it becomes very obvious that the dialog that does not call pictureBox1.Image.Dispose(); leaks memory really badly.
Does anyone have a suggestion for a tool that would show up the problem in such a clear way?
Is there any way to count memory allocation/deallocation for a particular c# source file? At least this was something I was able to do with unmanaged C++.