Date: Mon, 22 Jan 2001 10:25:54 -0800 From: "Crist J. Clark" <cjclark@reflexnet.net> To: Kris Kennaway <kris@FreeBSD.org> Cc: questions@FreeBSD.org Subject: Re: small program eats lot of memory Message-ID: <20010122102554.A77938@rfx-216-196-73-168.users.reflex> In-Reply-To: <20010122025541.B84078@citusc17.usc.edu>; from kris@FreeBSD.org on Mon, Jan 22, 2001 at 02:55:41AM -0800 References: <14955.1209.195848.394006@guru.mired.org> <01012121054701.03293@buffy> <20010121152246.X10761@rfx-216-196-73-168.users.reflex> <20010121165041.A76170@citusc17.usc.edu> <20010121203207.F10761@rfx-216-196-73-168.users.reflex> <20010122025541.B84078@citusc17.usc.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 22, 2001 at 02:55:41AM -0800, Kris Kennaway wrote: > On Sun, Jan 21, 2001 at 08:32:07PM -0800, Crist J. Clark wrote: > > > > No, I believe he is correct. If you have two shared programs in > > > memory, the VM system will only have one copy of the libc code shared > > > between them (similarly with any other common libraries). > > > > That's really something if it's true. I don't see any mention of > > features like that on rtld(1). > > It's a generic feature of the VM system which shared libraries happen > to incidentally benefit from. If you map the same object more than > once, it only maintains one copy of it in VM, until one of the users > dirties a page (changes something), at which point the page is copied > ("copy on write"). Thanks for the followup. I did a little research and had found that answer. As you mention, once a page is 'dirtied' it must be copied. I realized that needed to happen, but it never occured to me you could wait for write before you actually do the copy. I see how that can save memory. Shows what I know about the VM. Thanks. -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010122102554.A77938>