Thread: .NET Bloat Using MSVS

  1. #1
    ¡Amo fútbol!
    Join Date
    Dec 2001

    .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.

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    I think alot of the memory is being used by the .NET framework.

  3. #3
    Registered /usr
    Join Date
    Aug 2001
    Newport, South Wales, UK
    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.

    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking for DX in setup and deployment in MSVS 05 .NET
    By VirtualAce in forum A Brief History of
    Replies: 0
    Last Post: 10-15-2006, 03:32 PM
  2. release vs debug in msvs .net 2003
    By axr0284 in forum Windows Programming
    Replies: 1
    Last Post: 01-10-2006, 01:52 AM
  3. VS .NET 2003 Is Bloat!
    By UnregdRegd in forum A Brief History of
    Replies: 14
    Last Post: 02-29-2004, 10:51 PM
  4. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM
  5. Visual J#
    By mfc2themax in forum A Brief History of
    Replies: 0
    Last Post: 10-08-2001, 02:41 PM