Subject: Re: tcsh static/dynamic mem usage
To: None <vdlinden@fwi.uva.nl>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: current-users
Date: 11/14/1993 14:35:31
> 10198 root       3    0  936K  644K sleep   0:00  3.30%  1.66% tcsh.dynamic
> 10196 root      18    0  552K  428K sleep   0:00  0.90%  0.59% tcsh.static

> The dynamically linked version uses much more memory than the statically
> linked version (huh?). Or is 'top' just confused by the shared memory
> pages?

I can't explain the 400K difference in the 'process size' field.
The increase in `resident' size is perfectly explainable from the
of the run-time linker actions. ld.so itself is about 70K in size, it uses
stack space, and it touches the data area of shared libraries all before
it gets around to calling `_main()'.

A better start to evaluate shlib overhead would a "null" program, something
like "main(){return 0;}" or "main(){sleep(100);}". I did some quick tests
with the former some weeks ago, and found that it runs three times slower
when linked dynamically (16ms vs 0ms user time, 40ms vs. 20ms system time).

-pk

------------------------------------------------------------------------------