From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 21 15:34:27 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807CB106566C for ; Fri, 21 Oct 2011 15:34:27 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [89.206.35.99]) by mx1.freebsd.org (Postfix) with ESMTP id E5AF78FC13 for ; Fri, 21 Oct 2011 15:34:26 +0000 (UTC) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.5/8.14.4) with ESMTP id p9LFYPAh013328; Fri, 21 Oct 2011 17:34:25 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.5/8.14.4/Submit) with ESMTP id p9LFYOsI013325; Fri, 21 Oct 2011 17:34:24 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Fri, 21 Oct 2011 17:34:24 +0200 (CEST) From: Wojciech Puchar To: Ivan Voras In-Reply-To: Message-ID: References: <4EA0610B.90206@gmail.com> <20111021084413.GA46039@server.vk2pj.dyndns.org> <4EA1471E.9050501@gmail.com> <4EA15004.50308@gmail.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (wojtek.tensor.gdynia.pl [127.0.0.1]); Fri, 21 Oct 2011 17:34:25 +0200 (CEST) Cc: freebsd-hackers@freebsd.org Subject: Re: Measuring memory footprint in C/C++ code on FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2011 15:34:27 -0000 >> footprint? > > Almost certainly yes. Measuring virtual memory is significantly less > important for real-world loads. Some of this is very nicely described > here: https://www.varnish-cache.org/trac/wiki/ArchitectNotes . definitely. just run top and compare RES and SIZE fields. extreme example: #include int blah[1000000000]; main(){sleep(1000);} run it and see this in top 13317 wojtek 1 45 0 3817M 684K nanslp 0 0:00 0.00% 1