On Tue, 16 Jan 2001, Ilya Konstantinov wrote:

> 1. What does the 'Shared memory' reading (/proc/meminfo) indicate?
>  Simple IPC shared memory?

my _guess_ is that this indicates the ammount of memory that is placed in
shared memory regions (either allocated using a shmat() call, or allocated
by the dynamic loader, for code segments of binaries/libraries).

> 2. If two processes owned by the same user load a shared library,
>  does the library load twice or only once?
>  And what about two processes with different owners?

if two library loads are made using the same absolute path, then they both
use shared _code_ segments (marked as read only and exetueable, by the
virtual memory system), and these segments are shared by all processes
using these libraries, regardless of UID and other permissions.

if you copy a shared library to a different disk location and make a
process use it, by changing the LD_LIBRARY_PATH, then when its run, a new
copy of the code pages in memory will be made.

data segments allocated by a library's code are never shared, except for
on the sharing done during a fork() system call (you know how form works,
i assume. if not - man fork).

--
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to