User forums > Using Code::Blocks
[Happy new year :-)] What compiler flags to set for AMD dual core ?
MortenMacFly:
--- Quote from: pel on January 01, 2008, 06:21:46 pm ---I just want to understand why a 7KB .exe file needs 560 KB appr. RAM,
--- End quote ---
...because it allocates it?! You can "malloc" even more with a one-liner in console app much smaller than 7kB.
Don't forget that you automatically have dependencies to (system) DLL's that are being loaded etc. I guess it's best you take a book about how an operating system works and start reading... ;-)
With regards, Morten.
thomas:
--- Quote from: pel on January 01, 2008, 06:21:46 pm ---I just want to understand why a 7KB .exe file needs 560 KB appr. RAM
--- End quote ---
Like I said, there are many reasons, and it means nothing.
For example, the default minimum working set under Windows is 50 pages (204,800 bytes). This means that regardless of anything else, at least 200 kB are held in RAM by the operating system's policy, even if a program has zero size and does nothing at all.
Similarly, every program reserves a stack frame of some size, which is often 1 MB (but can be anything), whether you do something or not.
Most of these things are beyond your scope as program writer. You have little or no control over them, and for the most part, you need not care about them either.
Navigation
[0] Message Index
[*] Previous page
Go to full version