HUGE Virtual Memory Usage

Matt Patterson matt at v8zman.com
Thu Oct 6 19:13:19 UTC 2005


Thanks for the info.

Matt



Tony Arnold wrote:

>Matt,
>
>On Thu, 2005-10-06 at 12:34 -0400, Matt Patterson wrote:
>
>  
>
>>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.
>>    
>>
>
>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.
>  
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20051006/4c1b2bec/attachment.html>


More information about the ubuntu-users mailing list