.NET Bloat Using MSVS
This is the first program I've written using windows forms, and the first thing that I notice is the amazing amount of memory used by such a simple program. 18k for a window with a couple labels, comboboxes, and buttons. I'm compiling in release mode. Is there any debugging information that is still being included that I can turn off? Thanks.
I think alot of the memory is being used by the .NET framework.
I think you're referring to the disk space that the program takes up rather than the memory (Usually at least a meg, that contains bits and bobs that Windows uses on your program's behalf as well).
Most C/C++ programs compile with the Common Runtime Library (CRT) linked in. This'll take up a few KB of your program's size but is necessary for standard C compliance. Also most modern compilers assume a memory page size of 4KB, which results in your program being slightly bigger than you may have envisaged. They do this because the alignment of the pages makes for optimal (fast) usage.
Pre-Windows 98, compilers opted for 512 byte pages instead. This will make your program smaller, and is compatible with all versions of Windows. I believe with Visual C++ the linker flag is -NOWIN98, but the most recent versions may have gotten rid of that.
And, as mentioned, .NET linkage does bloat a bit. :rolleyes:
For your information, the smallest Windows program I've ever made was around 600 bytes in size. That was hand-coded from scratch though, no compiler, pure machine code. :cool: