From owner-freebsd-stable@FreeBSD.ORG Tue Aug 14 18:38:51 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 063EE16A418 for ; Tue, 14 Aug 2007 18:38:51 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by mx1.freebsd.org (Postfix) with ESMTP id D999A13C483 for ; Tue, 14 Aug 2007 18:38:50 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 5AA98135CA; Tue, 14 Aug 2007 14:38:35 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 14 Aug 2007 14:38:38 -0400 X-Sasl-enc: E2A4EdokCfKX1prwuZdWMo/7x/ZlRETowSZyYTOX6InR 1187116715 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id CDB33A57; Tue, 14 Aug 2007 14:38:34 -0400 (EDT) Message-ID: <46C1F6A3.1000101@incunabulum.net> Date: Tue, 14 Aug 2007 19:38:27 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Pete French , freebsd-stable@FreeBSD.ORG References: <20070814164154.GA39532@eos.sc1.parodius.com> In-Reply-To: <20070814164154.GA39532@eos.sc1.parodius.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: Static linking and memory usage X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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 18:38:51 -0000 Jeremy Chadwick wrote: > This reminds me: it sure would be useful if we had something like > Solaris's pmap(1) on FreeBSD. > > In response to the original post: The kernel's ELF linker/loader for executables will share the text and read-only segments for static executables. We already have something similar to pmap in the ports collection, called pmap. However, there is a very detailed and powerful tool for Linux called Exmap, by John Berthels. I used it to profile XORP's shared library memory usage in great detail, i.e. it gave me figures on how much memory was saved by the text page sharing introduced by the use of shared libraries across related executables, enabling me to answer the question, "Is the additional work of shared libraries worth the hassle?" I don't have free time to port Exmap to FreeBSD, but if someone does, I can put them in touch with John and forward his fairly detailed explanation of how to go about doing that. pmap would be a starting point for such a port. regards, BMS