From owner-freebsd-stable@FreeBSD.ORG Tue Aug 14 22:07:43 2007 Return-Path: Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0332D16A417 for ; Tue, 14 Aug 2007 22:07:43 +0000 (UTC) (envelope-from davids@webmaster.com) Received: from mail1.webmaster.com (mail1.webmaster.com [216.152.64.169]) by mx1.freebsd.org (Postfix) with ESMTP id E294913C461 for ; Tue, 14 Aug 2007 22:07:42 +0000 (UTC) (envelope-from davids@webmaster.com) Received: from however by webmaster.com (MDaemon.PRO.v8.1.3.R) with ESMTP id md50001632854.msg for ; Tue, 14 Aug 2007 15:07:43 -0700 From: "David Schwartz" To: Date: Tue, 14 Aug 2007 15:07:12 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Importance: Normal X-Authenticated-Sender: joelkatz@webmaster.com X-Spam-Processed: mail1.webmaster.com, Tue, 14 Aug 2007 15:07:43 -0700 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 206.171.168.138 X-Return-Path: davids@webmaster.com X-MDaemon-Deliver-To: freebsd-stable@FreeBSD.ORG X-MDAV-Processed: mail1.webmaster.com, Tue, 14 Aug 2007 15:07:43 -0700 Cc: Subject: RE: Static linking and memory usage X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davids@webmaster.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2007 22:07:43 -0000 > If I have an executable which is staticly linked with many copies > of it running (a CGI script in fact), will all those copies share > the text segment of the executable on the disc, or will it actually > use up real memory resource with many copies of the executable ? I > have been assuming the former, but possibly that is not correct. As is the case for all files, if the contents are not modified, the physical memory is shared. Two or more processes can map the same page of the same file and will get the same physical page of memory, normally marked unshare/copy-on-write. DS