On Tue, Apr 18, 2006 at 07:19:08PM -0400, Brantley Coile wrote:
> > #2 Supposed physical memory savings - libSystem on Mac OS X only
> > exists in memory 1 time for all the programs that use it... sorta.
> > Read Only pages are shared, writable pages are COW and yes, this adds
> > a good deal of complexity to the VM of the OS to have this.
>
> Before X windows, 10% of programs were from the library. With X
> windows that number ballooned to 90%, so there is an apparent (see
> below) space savings with X windows. This is because when to touch
> anything you get everything. That, I would argue, is bad design. (I
> added shared library to a custom embedded Unix I did 15 years ago
> because the application was also mis-designed.) The X library is
> really a sub-system that should be somewhere other than the user's
> program.
Speaking of which: since I'm a bit behind when it comes to the
modern X, it was only a week ago that I discovered a global
conspiracy called Font rendering via RENDER extension. It looks
to me that the usual confusion about who's the server and who's
the client in X-world has finally reached its peak. So much so, that
a simple task of rendering a string of text with a particular
font (which 5 years ago required a couple of X* calls) now
requires each client to have a deep and profound knowledge of
what hardware each Xserver is running on. And of course, requires
an application as simple as Xterm being dynamically linked with
5-6(!) additional libraries. Worse yet -- it requires *EVERY*
application to be linked with these libraries since now its
client's responsibility to render text:
$ ldd /usr/X11/bin/xterm | wc -l
20
$ ldd /opt/MozillaFirefox/lib/firefox-bin | wc -l
52
And did I mention the use of XML config files to manage all of the
complexity the client has to face from now on ?
Madness... :-(
> Also on the down side, shared libraries make it hard to distrubute
> binaries without also sending out the library. The binary, or even
> the files in the same directory, are no longer all that is required to
> run the program. You also have to have the correct version of the
> library. Since you get different binaries that need different
> versions of the library, you now wind up with three or six or more
> slight variations of the same library, all get loaded into core. Now,
> where's my space saving? Remove one and now you have a bunch of
> programs that don't work, but you don't know it yet.
It gets even more entertaining when it comes to doing forensics on
'core' files generated by a binary with an ldd output longer than
Bill Gates's tax return. :-(
Thanks,
Roman.