XAML Form used a lot more memory than a normal WinForm?

Worrow

Regular
Joined
Jul 10, 2003
Messages
68
Just start trying XAML. Put a button and a textbox in it and built the application. The size of file seems the same as the WinForm one, but when I ran the application it took like 20+Mb instead of 8+Mb(for the WinForm, which I consider is huge already). Why the XAML made form takes so much memory? Doesn't XAML get transform into CLR which should be the same as the WinForm? I am surely missing something here:confused:
 
A bit late answering this one I know but...

XAML applications are fundamentally different to a normal window application, even though the code itself is compiled down to MSIL the actual front end isn't built using standard windows controls.

WPF applications have their own windowing system based around DirectX and it is probably this extra overhead that is accounting for some of the differerences in memory usage.

WPF really is designed for newer systems with plenty of resources and cpu / graphics power as opposed to older and lower specced machines.
 
XAML can do a lot of fancy UI stuff, including the separation of layout from code for a lot of the day to day things.
As an example the author of this book has a sample RSS reader done entirely in XAML and no procedural code used at all.
 
Back
Top