getrusage/size discrepancy

getrusage/size discrepancy

Post by Marc Tardi » Mon, 16 Oct 2000 04:00:00

I have a simple program which only calls getrusage
and prints a few values. I then run the program
and compare the output against what size(1)
returns. This is what I got:

$ ./a.out
max resident set size: 1312
integral shared text memory size: 288
integral unshared data size: 188
integral unshared stack size: 128
$ size a.out
   text    data     bss     dec     hex filename
   1644     196     272    2112     840 a.out

Can someone explain why these figures don't
match? I'd expect at least "text" and "data" to
look alike, but they really don't...


1. 4 byte discrepancy in binrary size

When I repeatedly compile a binary I sometimes get a 4 byte
discrepancy in the size. E.g.

-rwxr-xr-x   1 me group 3677712 Aug 25 16:48 MyBinary.1
-rwxr-xr-x   1 me group 3677716 Aug 25 17:01 MyBinary.2
-rwxr-xr-x   1 me group 3677716 Aug 25 17:03 MyBinary.3
-rwxr-xr-x   1 me group 3677712 Aug 25 17:14 MyBinary.4

I thought compilation and linking would be deterministic? Nothing
changes between the compilations.

Any idea why the linker does this?

Platform = SunOS 5.8 Generic_117000-05 sun4u sparc SUNW,Sun-Fire-280R

2. Corel Draw for Linux

3. Swap size discrepancy

4. a util to access fat32 with 2.0.31?

5. Disk freespace discrepancy

6. Installing a DITTO MAX

7. 'df' numbers discrepancy?

8. Linux 2.4.19ac3rc3 on IBM x330/x340 SMP - "ps" time skew

9. Timestamp discrepancy

10. I want to fix _some_ discrepancies

11. asclock and time discrepancy

12. HELP! Top & Memory Usage Discrepancy

13. No. of Cyls - discrepancy (x86)