Skip site navigation (1)Skip section navigation (2)
Date:      10 Nov 2000 12:02:47 -0500
From:      Randell Jesup <rjesup@wgate.com>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        Alfred Perlstein <bright@wintelcom.net>, arch@FreeBSD.ORG
Subject:   Re: The shared /bin and /sbin bikeshed
Message-ID:  <ybupuk3pxoo.fsf@jesup.eng.tvol.net.jesup.eng.tvol.net>
In-Reply-To: Matt Dillon's message of "Thu, 9 Nov 2000 19:26:06 -0800 (PST)"
References:  <200011091223.eA9CNQW26294@mobile.wemm.org> <200011091909.eA9J9wM10639@earth.backplane.com> <20001109112328.T5112@fw.wintelcom.net> <200011091944.eA9JiSN30771@vashon.polstra.com> <20001109115022.Y5112@fw.wintelcom.net> <200011100326.eAA3Q6015450@earth.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Matt Dillon <dillon@earth.backplane.com> writes:
>    Linking with a shared library eats memory at run time.  It's that simple.
>    Shared libraries make life easier but they do *NOT* generally reduce
>    the run time in-core memory footprint of a machine.  Dynamic executables
>    actually increase the number of dirty pages the system has to cope with,
>    at least for discretely-run programs, and they tend to force the entire
>    shared library into core.

        Hmmm.  I did some tests of shared-library memory use in FreeBSD and
Linux, for a simple libraries with 1 entrypoint and about 2K of code.  It
appeared that each open library causes 4K usage (according to ps) in
FreeBSD, and 8K in Linux.  Of course this doesn't tell us how the usage
scales with increasing numbers of entrypoints or complexity of code
(relocations).

        If I have saw 20 instances of an executable with 100 shared
libraries, or 20 instances of an executable with 5 (much larger) shared
libraries, or 20 instances of a very large mostly static executable,
what is the relative memory hit?  Or swap hit?  My test may have been
too simple....  How different would the answer be in Linux?

        (This is for working on figuring out how much of a win it is in
Mozilla to combine shared libs, which some people are working on.)

-- 
Randell Jesup, Worldgate Communications, ex-Scala, ex-Amiga OS team ('88-94)
rjesup@wgate.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ybupuk3pxoo.fsf>