<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks for the info.<br>
<br>
Matt<br>
<br>
<br>
<br>
Tony Arnold wrote:
<blockquote cite="mid1128623672.12330.7.camel@localhost.localdomain"
type="cite">
<pre wrap="">Matt,
On Thu, 2005-10-06 at 12:34 -0400, Matt Patterson wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Another question: If using a shared library requires it to be loaded
into ram, and that means huge ram usage as I am seeing because the
modules are large, would it not be more memory efficient (I know it
wastes hard disk space) to simply statically link apps instead of
dynamically. Then apps wouldnt have dependency issues and they would
only load the necessary routines into memory? Of course there would be
redundancy in memory because each app could load the same functions,
but still.
</pre>
</blockquote>
<pre wrap=""><!---->
There is clearly a trade off here and with a small number of
applications where each only uses a small number of routines from
libraries, you may get some gain, however, the shared library is
probably best in the long run.
You have to remember that it does not cost a great deal of resource to
have a large shared library in virtual address space. With the paging
algorithms in Linux only the pages of the library that get referenced,
ie., actually run or have data will ever get loaded into real memory.
And if the same page(s) of a shared library are used by more than one
application, it is only loaded once!
The other advantage of shared libs is that you do not have to re-link
all the applications that use it if it gets updated (mostly!), whereas
with statically linked apps you would. You could then end up with apps
linked against different versions of the library and then get
inconsistencies.
In fact Ian Murdoch's (the founder of Debian) idea to separate out
libraries from applications at the package level is partly what makes
the update process of Debian derived Linux systems so straight forward.
Regards,
Tony.
</pre>
</blockquote>
<br>
</body>
</html>