From owner-freebsd-questions Mon Jan 22 10:26:38 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailhost01.reflexnet.net (mailhost01.reflexnet.net [64.6.192.82]) by hub.freebsd.org (Postfix) with ESMTP id 7908637B400; Mon, 22 Jan 2001 10:26:21 -0800 (PST) Received: from rfx-216-196-73-168.users.reflexcom.com ([216.196.73.168]) by mailhost01.reflexnet.net with Microsoft SMTPSVC(5.5.1877.197.19); Mon, 22 Jan 2001 10:24:03 -0800 Received: (from cjc@localhost) by rfx-216-196-73-168.users.reflexcom.com (8.11.1/8.11.0) id f0MIPsV77966; Mon, 22 Jan 2001 10:25:54 -0800 (PST) (envelope-from cjc) Date: Mon, 22 Jan 2001 10:25:54 -0800 From: "Crist J. Clark" To: Kris Kennaway Cc: questions@FreeBSD.org Subject: Re: small program eats lot of memory Message-ID: <20010122102554.A77938@rfx-216-196-73-168.users.reflex> Reply-To: cjclark@alum.mit.edu 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20010122025541.B84078@citusc17.usc.edu>; from kris@FreeBSD.org on Mon, Jan 22, 2001 at 02:55:41AM -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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