Archive for June 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.

Windows Usability

Windows usability has steadily improved since Windows 3.1 days. However, one huge problem still persists: applications pop up to front and take input focus asynchronously. One moment you’ll be typing in one window and then the next moment you’ll find yourself typing into a completely different window. Internet Explorer has a habit of doing this, and so does Visual Studio when debugging.

An unrelated but equaly frustrating problem is the way the taskbar tries to make you feel uncomfortable because you are in a debugging session. One of the asserts I have never seen before has fired last night at 1 AM. Never mind, I said, I just had a beer and am in no state to debug. So I’ll just leave the debugging session open, do other stuff, and will examine the program state tomorrow morning. Then I accidentaly clicked on the program being debugged on the taskbar. Windows tried to shift the focus to it but failed because the program was paused in the debugger. This caused the taskbar to stop functioning and I was left with Alt-Tabbing between 30 or so open windows. Sigh.