Re: process size
From: Andrei Voropaev (avorop_at_mail.ru)
Date: 02/04/04
- Next message: Nils O. Selåsdal: "Re: Thoughts on Semaphores"
- Previous message: Terence Tan: "Re: Wierd UDP server issues."
- In reply to: Hans-Bernhard Broeker: "Re: process size"
- Next in thread: Jerry Feldman: "Re: process size"
- Reply: Jerry Feldman: "Re: process size"
- Reply: Hans-Bernhard Broeker: "Re: process size"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Nils O. Selåsdal: "Re: Thoughts on Semaphores"
- Previous message: Terence Tan: "Re: Wierd UDP server issues."
- In reply to: Hans-Bernhard Broeker: "Re: process size"
- Next in thread: Jerry Feldman: "Re: process size"
- Reply: Jerry Feldman: "Re: process size"
- Reply: Hans-Bernhard Broeker: "Re: process size"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|