On Fri, 23 Jan 2009, Randall R Schulz wrote:-
On Friday January 23 2009, David Bolt wrote:
The code itself may be bigger but, looking at the sizes of applications in /bin on both a 32bit and 64bit system, and the libraries in /lib abd /lib64, I wouldn't say the sizes are anything more than about 10% bigger.
Use the "size" command, not the file size.
Okay, here's the output for the first 20 files in /bin for a 64bit and 32bit 10.3: davjam@adder:~> find /bin -type f | sort | xargs size 2>/dev/null | head -20 text data bss dec hex filename 1478 552 8 2038 7f6 /bin/arch 129290 1832 20704 151826 25112 /bin/ash 688532 4072 33584 726188 b14ac /bin/ash.static 14174 1024 392 15590 3ce6 /bin/basename 629025 22776 16880 668681 a3409 /bin/bash 33679 3440 17352 54471 d4c7 /bin/blkparse 23164 2944 248 26356 66f4 /bin/blktrace 17867 1032 392 19291 4b5b /bin/cat 38433 1128 424 39985 9c31 /bin/chgrp 34962 1088 456 36506 8e9a /bin/chmod 40631 1168 424 42223 a4ef /bin/chown 3342 640 24 4006 fa6 /bin/chvt 61757 1544 568 63869 f97d /bin/cp 116523 4888 1936 123347 1e1d3 /bin/cpio 45135 3408 488 49031 bf87 /bin/date 6049 720 16 6785 1a81 /bin/dbus-cleanup-sockets 315436 4004 1448 320888 4e578 /bin/dbus-daemon 9545 848 8 10401 28a1 /bin/dbus-monitor 12490 936 16 13442 3482 /bin/dbus-send davjam@cobra-mk3:~> find /bin -type f | sort | xargs size 2>/dev/null | head -20 text data bss dec hex filename 1154 280 4 1438 59e /bin/arch 108311 1008 19196 128515 1f603 /bin/ash 612700 2356 26752 641808 9cb10 /bin/ash.static 12238 532 388 13158 3366 /bin/basename 584686 12016 14992 611694 9556e /bin/bash 34193 2572 13156 49921 c301 /bin/blkparse 20044 1924 176 22144 5680 /bin/blktrace 16151 516 388 17055 429f /bin/cat 35580 568 420 36568 8ed8 /bin/chgrp 32041 544 420 33005 80ed /bin/chmod 37658 588 420 38666 970a /bin/chown 2598 324 12 2934 b76 /bin/chvt 57727 788 524 59039 e69f /bin/cp 106815 2756 1768 111339 1b2eb /bin/cpio 44019 2328 420 46767 b6af /bin/date 5597 364 16 5977 1759 /bin/dbus-cleanup-sockets 289830 2160 1024 293014 47896 /bin/dbus-daemon 8653 428 8 9089 2381 /bin/dbus-monitor 12070 472 8 12550 3106 /bin/dbus-send Yes, they are bigger, taking up more space on disc and more memory, but nowhere near double the space. So, while the 64bit binaries are close to 10% bigger and you'd probably need at least 10% more memory to avoid using swap[0], that isn't really "substantial" especially since you seem to be assuming that they are going to require double the memory.
...
As for the data, why would it be "substantially" larger on a 64bit system? Pointers are going to be bigger on the 64bit system, as are variables of type "long", since these are 64bit, but those of type "int", and smaller, still occupy the same sizes in both the 32bit and 64bit OSes.
It's "substantial" because every pointer and every int is twice as big in a 64-bit programming model compared to a 32-bit one.
Well, you're partially right. On a 64bit system, the pointers are indeed 64bit, longs are 64bits, but ints are still 32bit: davjam@adder:~> uname -m ; cat hello.c ; gcc -O3 -Wall -o hello.64 hello.c ; ./hello.64 ; ls -l hello.64 x86_64 #include <stdio.h> #include <stdlib.h> int main(int argc,char **argv) { printf("Hello world\n\n"); printf("sizeof(int)\t%lu\n", (unsigned long)sizeof(int)); printf("sizeof(long)\t%lu\n", (unsigned long)sizeof(long)); printf("sizeof(char *)\t%lu\n", (unsigned long)sizeof(char *)); exit(0); } Hello world sizeof(int) 4 sizeof(long) 8 sizeof(char *) 8 -rwxr-xr-x 1 davjam users 10866 2009-01-23 14:57 hello.64 And just as a comparison: davjam@cobra-mk3:~> uname -m ; cat hello.c ; gcc -O3 -Wall -o hello.32 hello.c ; ./hello.32 ; ls -l hello.32 i686 #include <stdio.h> #include <stdlib.h> int main(int argc,char **argv) { printf("Hello world\n\n"); printf("sizeof(int)\t%lu\n", (unsigned long)sizeof(int)); printf("sizeof(long)\t%lu\n", (unsigned long)sizeof(long)); printf("sizeof(char *)\t%lu\n", (unsigned long)sizeof(char *)); exit(0); } Hello world sizeof(int) 4 sizeof(long) 4 sizeof(char *) 4 -rwxr-xr-x 1 davjam users 9100 2009-01-23 14:59 hello.32 As you can see from the above, cobra-mk3 is running the 32bit version of 10.3, while adder is running the 64bit version. [0] Of course, the only real way to avoid using swap is to have sufficient memory available and to disable swap altogether. Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s | openSUSE 10.3 32b | openSUSE 11.0 32b | openSUSE 10.2 64b | openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.6 | RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org