My software development company does a fair amount of WPF programming. We after all have a point of sale system created in Microsoft Blend 3 and Visual Studio 2008.
Anyone reading this article already knows that WPF is like the holy grail of easy to create stunning user interfaces. The issue however is that WPF is a really memory intensive technology, that in itself isn’t so bad, the reality however is that no matter who or what your program is, the chances are 99% that your program is leaking memory and that there is absolutely nothing that you can do about it.
What baffles me is that Microsoft can be forgiven for getting this wrong in its first version of the technology but at this stage with dotnetframework 3.5 out, they have had plenty of time to iron out the bugs and for me memory leaking is the most inexcusable bug you can have. I am not sure if it is WPF or the garbage collector that doesn’t do a good job, the chances are its both, but it is a huge frustation. My point of sale system goes through a process of opening up the same screens over and over in a particular day. The program starts with about 48mb loaded but by the end of the day I have clients calling to say the application is more than 300mb in memory. 300mb!!!!
This brings me to my next point and this is an important point I beleive. Yes I have done the research into memory leaks and yes I have made numerous coding adjustments with varied success. The reality is this…WHY SHOULD I!!!
When you buy a programming language that claims to take care of memory issues, that’s exactly what you expect it to do. I don’t care that I may have event declarations still in memory or that I am referencing other pages etc…when I close a page, I expect it to unload completely. The irony is that the page does unload, according to the programming language, according to the memory on the computer however, that unload increased my programs memory by another 1mb. Microsoft needs to get there act together, the exact technology that is supposed to make designing professional graphical user interfaces (and it does) is occupying more of my time debugging for memory issues that are not my fault.
The unfortunate truth is that WPF is still so great that I can’t move from it and use a different technology, maybe in dotnet 4 things will be improved, I doubt it however.
I would be very interested in knowing other peoples frustrations with this technology as I am sure there are thousands of developers in exactly the same situation as me.

