From owner-freebsd-questions@FreeBSD.ORG Tue Apr 25 22:32:23 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6580516A402 for ; Tue, 25 Apr 2006 22:32:23 +0000 (UTC) (envelope-from erikt@owl.midgard.homeip.net) Received: from pne-smtpout1-sn1.fre.skanova.net (pne-smtpout1-sn1.fre.skanova.net [81.228.11.98]) by mx1.FreeBSD.org (Postfix) with ESMTP id E927543D45 for ; Tue, 25 Apr 2006 22:32:22 +0000 (GMT) (envelope-from erikt@owl.midgard.homeip.net) Received: from falcon.midgard.homeip.net (83.253.29.241) by pne-smtpout1-sn1.fre.skanova.net (7.2.070) id 443D0928002CA53A for freebsd-questions@freebsd.org; Wed, 26 Apr 2006 00:32:22 +0200 Received: (qmail 514 invoked from network); 26 Apr 2006 00:32:20 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with SMTP; 26 Apr 2006 00:32:20 +0200 Received: (qmail 90849 invoked by uid 1001); 26 Apr 2006 00:32:20 +0200 Date: Wed, 26 Apr 2006 00:32:20 +0200 From: Erik Trulsson To: kapil jain Message-ID: <20060425223220.GA90792@owl.midgard.homeip.net> Mail-Followup-To: kapil jain , freebsd-questions@freebsd.org References: <20060425213554.24941.qmail@web81110.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060425213554.24941.qmail@web81110.mail.mud.yahoo.com> User-Agent: Mutt/1.5.11 Cc: freebsd-questions@freebsd.org Subject: Re: top on freebsd and wired memory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Apr 2006 22:32:23 -0000 On Tue, Apr 25, 2006 at 02:35:54PM -0700, kapil jain wrote: > Hi, > > I have a question, top on freebsd displays active, inactive and wired memory. > Since kernel memory has to be non-pageable isn't it that user process > resident memory should be active + inactive? No. 'Inactive' can (and usually does) include memory that was used by processes that are no longer running. > However I see some discrepancy. For eg. active is 34M, inactive 116M. > top -s 100 gives me resident sizes of all processes, if I sum them up it > comes to about 75M. So where is the rest of 116+34-75 = 75M? Keep in mind that the resident size of a process (as displayed by top(1) or ps(1)) includes any shared libraries it is using. Memory for shared libraries can however be shared between several different processes. If you have several instances of the same program running at the same time their codepages are usually shared. This means that the total memory used by a set of processes is usually *less* then the sum of their size as displayed by ps(1) or top(1). -- Erik Trulsson ertr1013@student.uu.se