October 24, 2006

Lots of RAM for .Net Programs

Filed under: .Net,Programming — pj @ 1:27 pm

Developing in .net and C# is OK, but every little utility uses 20MB of RAM… it’s such a waste. I’ve got this little ping utility that is just a few files of C# code… the .net code isn’t much different than it would be in MFC (or a text base UI like curses for that matter). Internally, the program uses almost no RAM – just a list of hosts and a few settings and statistics for each host.

But my little .net app uses 19MB RAM and that’s for the “release” build. It makes .net apps easy to find in Task Manager, though…. just sort the process list by RAM usage – my ping utility is #2 (2nd to MSN messenger).

The same program in C would  probably use less than 512 KB. In C++ with MFC I’d guess 2 MB or less. Using a Virtual Machine is supposed to be safer than running native code, but there sure must be a lot of room for exploits with an “extra” 17 MB or so of code (or something) loaded into RAM…

2 Responses to “Lots of RAM for .Net Programs”

  1. pj says:

    A few hours later, the ping utility is really easy to find… it’s #1 with 38MB RAM in use.

  2. [...] It’s been more than a couple of years since my last serious desktop GUI application. At that time, Windows and MFC were the obvious platform. If I had to run the application on Linux, I think I would have tried to get something going with Winelib, but MFC support under Winelib has always looked like a PITA. For new development, I would consider using Qt or wxWigits. My big complaint about both these libraries is the deliberate lack of support for exceptions – talk about stuck in the dark ages. I’ve done a little bit of WinForms programming. Overall, I think the library is pretty good (and with Mono, it could be cross-platform). My worry is the distribution requirements (though, eventually Windows 9X, ME and 2000 are finally starting to fade away) and the hefty resource requirements. [...]

Leave a Reply

Powered by Teztech