I have a C++ dll which reads the certain file format. If I use this dll using WPF application it consumes 1Gb of memory but if I use the same dll using MFC application it uses 200Mb of data.
My initial guess is it is taking some memory while dynamic memory allocation although I am not sure. I know that its hard to guess the possible culprit without code . All I want is there any checks I can do to make sure that I am not missing any settings which I should have used or any suggestion which might help.
And yes I did try various Profile none of them shows any memory leaks.
UPDATE : Using procdump I get to know more detail about memory consumption. Below is the snapshot of the output of DebugDiag analysis report. It shows virtual memory consumption of 2.23 GB for WPF app with C++ dll and for MFC app with C++ dll it shows 60MB.
var a = c.GetB().GetA();
and forgetting that result ofGetB()
shoulf be ref counted and released. At least thats's what I've seen the most. – DanylukGC.Collect();
on occasion? – Tomsk.Net memory profiler
to find memory-related issues. Really liked the tool. It has evaluation period so I suggest you give it a try. For me, it helped to finish a month-long chase of simple typo - there was+=
instead on-=
. – Arachnid