OutlookStyleApp - MemoryLeak

Topics: Prism v4 - WPF 4
Mar 12, 2011 at 11:58 PM
Edited Mar 13, 2011 at 1:01 PM


I am using the architecture like in the Outlook-Style-App descibed here: http://mansoormehmood.blogspot.com/2010/06/how-to-build-outlook-style-application.html

I use it with Prism V4

I have now determined, that there will be a MemoryLeak. For example when you start the app and click the button for a new mail and then close the window, the NewEMailViewModel and the NewEMailUseCase still exists in the memory. I am searching for the reason for several hours, but don't find it. Now I hope someone there can help me.


You can download my OutlookStyleApp ported to Prism V4 from http://dl.dropbox.com/u/4701983/OutlookStyleApp.rar
Here can you find a Printscreen of the Graph of NewEmailUseCase, after the NewEmail-Window is closed (and the UseCase should also be close/ended):
And here a picture of the graph in the same sitution of NewEmailViewModel:

Best Regards, Thomas

Mar 14, 2011 at 7:15 PM

Hi Thomas,

We've tried to reproduce the memory leak you're reporting with your sample and were unable to do so.

We've added some dummy data to both the ViewModel and the UseCase (see code below), and found that, when the memory grew bigger, the Garbage Collector released the memory:

dummyData = new byte[209715200];
for (int i = 0; i < dummyData.Length; i++)
dummyData[i] = 0;

If you find a situation in which this doesn't happen, it would be helpful if you could share your results with us, so that we can help you further debug the application to find out the possible leak.


Miguel Bronzovic


Mar 15, 2011 at 9:27 PM

Hi Miguel

Did you receive my Message?

Best Regards, Thomas

Mar 17, 2011 at 3:27 PM

Hi Thomas, I didn´t receive any message. Could you post again your question, here?


Miguel Bronzovic


May 12, 2011 at 12:50 PM

Hi Thomas,

I am having memory leaks issue in my prism application as well, however, I would like to know the took used for memory management, which one are you using to produce the images in your dropbox? NewEmailUseCase , I am looking exactly at some tool like this.



May 12, 2011 at 1:14 PM


I have used dotTrace from JetBrains (http://www.jetbrains.com/profiler/)

Can you inform me, when you find your issues? - Perhaps we can do something together? - You can add me to skype (Skype-Name: t.kehl).


Oct 18, 2011 at 10:32 PM

What fixes did you guys make for this? Profiling with Red Gate memory profiler, i see that NewEmailToolbarViewModel seems to have a memory leak.