Possible duplicate:
Why are compiled Java class files less than C compiled files?
Just out of curiosity, I just compiled Hello Worlds in C, C ++, and Java.
The Java class file only looks very meager on the 423B, which I understand since the runtime is not included in the binary.
C and C ++ have a value of 8.5K and 9.2K.
Why are they so big? I always assumed that stdio or iostream are linked dynamically and do not add to the size of the executable.
So where do all kilobytes come from? Looking at hexdump, I see that there are many add-ons, I think, for performance reasons. Why is the binary format exactly this way?
Link
pmg is very useful!
Regarding indentation, I found that aligning program segments to the borders of virtual memory pages (4096 bytes) leads to the fact that it is at least 8192 bytes.
Regarding binary mach-o format (for OS X and iOS)
For best performance, segments should be aligned at the borders of virtual memory pages - 4096 bytes for PowerPC and x86 processors. To calculate the size of a segment, add the size of each section, then round the amount to the next border of the virtual memory page (4096 bytes or 4 kilobytes). Using this algorithm, the minimum segment size is 4 kilobytes, and then its size is 4 kilobytes.
quoting http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html
I will do research before asking next time;)