Shared libraries

Jeff d'Arcy jdarcy at seqp4.ORG
Thu Apr 18 03:30:59 AEST 1991


mohta at necom830.cc.titech.ac.jp (Masataka Ohta) writes:
>You may claim shared libraries reduces the amount of required memory.
>But, even if you run all the command at the same time, total code
>space consumed is only 24884KB (including non-library code). On the
>other hand, if you run single X11 application, with shared library,
>mere /lib/X11.a consumes 3.3MB of virtual (and often real, as libraries
>tends to be scattered) memory.

Wizardly note: du isn't very useful for determining a program's resident size.

This may work for the *workstation* case, but X clients usually run on a shared
host.  On the machine I'm using right now, the various X libraries include a
total of about 525KB of text (data and bss don't count for this comparison
since they wouldn't be shared anyway).  Without shared libraries, we would need
10.5MB to run 20 different programs linked with all of these libraries.  With
shared libraries we'd only need 525K, which is an approximately 10MB savings.

In point of fact, 10MB is not a lot on real machines, especially since it's
pagable.  This means that shared libraries are not a really *big* win for X,
which uses ridiculous amounts of private data space, but they work really well
for something like libc.a.  I guess having libc shared would free up space for
all those X applications, though.  8]

In short, your implication that shared libraries are useless is unfounded.  I
don't think I'm the only one who'd like to see more *facts* in your posts to
back up your abundant opinions.
-- 

  Jeff d'Arcy, Generic MTS, Sequoia Systems Inc. <jdarcy%seqp4 at m2c.org>
Yonder nor sorghum stenches shut ladle gulls stopper torque wet strainers



More information about the Comp.unix.wizards mailing list