Re: process size

From: Andrei Voropaev (avorop_at_mail.ru)
Date: 02/04/04


Date: 4 Feb 2004 10:13:34 GMT

On 2004-02-02, Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> wrote:
> Frank <fgeck@optonline.net> wrote:
>> First part of my quesion is on ps -lu the SZ is given this is in pages
>> right? What is the page size on a Linux RH 2.1 WS?
>
> 4 KiByte
>
>> Second, I have 2 version of a program. One using our chared lib's and
>> another useing archived version. Why woud the shaed one show the
>> process size larger then the shared one,
>
> There must be one "shared one" too much in that sentence... ;-)
>
>> is that not the resaon for a shared lib to cut down on memory use?
>
> Not as far as a single process is concerned. Shared libraries
> conserve space on disk, and by being *shared* among processes in
> memory (thus the name). But to do that, each process has to map the
> *entire* shared library into its local memory, where an ordinary,
> archive-style library would only pull in those routines from a library
> it actually needs, so the individual process size is usually larger
> when shared libs are used.

I always believed that shared libraries also save space in RAM :) The
process has to map the code into its memory. But that memory is
"virtual". Shared libraries allow to map single physical memory page
into multiple processes, thus saving physical memory. Of course the size
of "virtual" memory of the process shall be bigger in this case. Shared
libraries make sense only when there'll be many different applications
using this library.

>
>> Does ps count the shared space too? Any way to tell how much is
>> shared or not? Want to see how much we save
>
> Only 'top' seems to display that information. See it's "SHARED"
> column.
>

Try to read man proc. Section for 'statm' describies which columns are
in /proc/your_pid/statm file. For my system third column specifies how
many pages are shared (just do cat /proc/your_pid/statm)

Andrei



Relevant Pages

  • Re: W3WP memory usage
    ... You may be correct regarding the libraries using the lion's share of memory. ... > I am quite aware that Sharepoint files are stored in the database. ... >>> public class SPVersion ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Will a large library cause WMP10 to slow system to a halt?
    ... 704 Megabytes Installed Memory ... of case likely would slow nearly everything down - not just the WMP. ... I have 2 250 Gb drives in a RAID 1 ... If you don't use libraries, how do you play music in WMP? ...
    (microsoft.public.windowsmedia.player)
  • Re: [RFC 0/3] Recursive reclaim (on __PF_MEMALLOC)
    ... Once the memory requirements of a userspace daemon ... Yes, and also inspect the code to ensure it doesn't violate mlock_all by execing programs, dynamically loading libraries, etc. ... In nbd-server, there's no dlopen, and I do not currently plan to add ... Avoiding glib is a good start. ...
    (Linux-Kernel)
  • Re: Memory leak when using OleDb
    ... say 2000 times you'll see that the memory of the ... such a tremendous leak in the OleDb libraries of .NET nor in the OleDb ... accesses COM objects throught Runtime Callable Wrappers. ...
    (microsoft.public.dotnet.framework)
  • Re: Dlls,memory allocation
    ... quite a few dlls and execute. ... be no dynamic memory in the libraries.. ... In that case, the allocation /freeing will ...
    (comp.lang.c)