From owner-freebsd-current Thu Oct 31 10:38:37 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F56B37B401 for ; Thu, 31 Oct 2002 10:38:36 -0800 (PST) Received: from conure.mail.pas.earthlink.net (conure.mail.pas.earthlink.net [207.217.120.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC81343E6E for ; Thu, 31 Oct 2002 10:38:35 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0203.cvx21-bradley.dialup.earthlink.net ([209.179.192.203] helo=mindspring.com) by conure.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 187KDB-0007V8-00; Thu, 31 Oct 2002 10:38:34 -0800 Message-ID: <3DC1785D.843AFF86@mindspring.com> Date: Thu, 31 Oct 2002 10:37:17 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Ollivier Robert Cc: current@FreeBSD.ORG Subject: Re: libc size References: <20021030214158.CB6EA2A88D@canning.wemm.org> <20021030221417.J22480-100000@herring.nlsystems.com> <20021031053202.GA26280@HAL9000.homeunix.com> <20021031080412.GB77041@tara.freenix.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ollivier Robert wrote: > According to David Schultz: > > Memory is even less of an issue; if a thousand copies of a shell > > are running, their text gets shared regardless of how they are > > linked. > > IIRC not exactly. In the dynamic case, some fixups are done by the dynamic > linker to "link" with the shared libs and that force the pages to be COW'd > thus taking more VM. That's why static binaries are more efficient too. > > (someone who understand these issues please correct me if necessary) There are one or more pages of indirection pointers that will initially point to "fixup" code, so that the first time you indirect through them, they get fixed up and then indirect through to the real code, and subsequent indirects indirect to the real code, rather than the fixup code. The number of pages that end up COW'ed is pretty minimal. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message