Friday, June 27, 2003

Fat .NET

I knew that .NET apps would be more memory intensive than native apps. But I assumed that they would be larger by some constant amount of memory. Instead, they seem to be N times larger, where N is a relatively big number.

I have an app that uses roughly 3 megs of heap and has less than 10 megs of binaries, including the system ones. Yet its private address space is 45 megs, and the working set is also fairly large even when the app is not doing that much.

But here's what surprised me the most: The very first thing that app does in debug mode is create a new AppDomain, loads a bunch of assemblies into it, runs some unit tests and then unloads that AppDomain. You'd expect the memory usage to drop to the level it was at before the newly created AppDomain started loading the assemblies, but I ended up with additional five megs in the address space.

   11:44 AM

Content of this site is © Dejan Jelovic. All rights reserved.