Re: memory question

From: Doug White <dwhite_at_gumbysoft.com>
Date: Fri, 20 Aug 2004 10:36:19 -0700 (PDT)
On Thu, 19 Aug 2004, Gustavo A. Baratto wrote:

> > It would be rather lame if libraries were exclusive access. :)  There may
> > be cases where they do get their own copies.  You shouldn't rely on this
> > behavior for any sort of memory-use calculations...
>
> Yes, I think it would be very lame too. But because of the fact you
> mentioned about the possibility of one process scribbling on the library
> pages, I was not sure the library would be shared between 2 processes in
> memory.

Mind you that if someone scribbles on the file on disk bad things will
happen.  :)

mmap() allows you to set access permissions on the mapped range, and I
think shared libs are mapped read only, so any writes to the area would
cause a segfault.  I'd have to test that, though.

> Is there a rule of thumb for memory use calculations?

Don't assume that "shared" pages are actually shared. :)

> BTW: is this the correct mailing list for such question?

questions_at_freebsd.org may be more appropriate for queestions about FreeBSD
that aren't version-specific, but questions about specifics of
implementations can be directed to the appropriate branch list.

-- 
Doug White                    |  FreeBSD: The Power to Serve
dwhite_at_gumbysoft.com          |  www.FreeBSD.org
Received on Fri Aug 20 2004 - 15:36:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:07 UTC