My program executable is 128K.

Why is the size reported in task manager 552K?
Your program is allocating stack space and other memory for libraries, etc. Task Manager is reporting the size of this allocated memory as well as your executable size.
Is there anyway to reduce this overhead? My program is not very big, and I only include 2 header files, one of which is my own and only about a page long. Can't I tell the compiler that I don't need to allocate that much space for whatever its allocating space for?

I mean, all of my functions are bool except 1, which is a char. Why is it allocating that much space? What can I do? Really, I think 500k is more space than the program will need.
Change the build target from debug to release.
This is how I compile a program.

I open codeblocks.
I press ctrl+shit+new.
I type ctrl+s.
I give it a name, with .cpp extension.
I include header files.
I type my code.
I press F9.

On the latest codeblocks, top left, build target defaults to debug, select it, change it to release. Otherwise, I don't know how else to change it.
I know nothing about codeblocks; however, there usually lots of compiler and linker options to minimize how you link in objects and libraries.
Ok i did that, i built it as a release project and the executable is now down to 51K. But now it uses 600K of memor.
Would you mind posting the code, if it's not too much?
Well if its not too much trouble, could you mind pointing me in the right direction as to where I can find out more about setting the compiler options to minimize size in memory?

I've been able to reduce the executable size down to 8.5KB, but yet the memory size in taskmanager is still 684K, on top of 1.3MB for conhost.exe which is launched automatically.
Something is really not right here, what is your code doing?
That's perfectly normal, it doesn't go any lower than that.
Your application needs an initial stack and heap and it always links the C runtime, which does some stuff of its own.

You can use TaskManagerEx to check the virtual memory space of your application.
Here's one of a simple C program that does absolutely nothing at all:
http://94.23.22.190/etc/wmmap.png
Topic archived. No new replies allowed.