From owner-freebsd-questions@FreeBSD.ORG Wed Apr 26 02:21:25 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 0543916A400 for ; Wed, 26 Apr 2006 02:21:25 +0000 (UTC) (envelope-from kapiltj@yahoo.com) Received: from web81106.mail.mud.yahoo.com (web81106.mail.mud.yahoo.com [68.142.199.98]) by mx1.FreeBSD.org (Postfix) with SMTP id 8512043D45 for ; Wed, 26 Apr 2006 02:21:24 +0000 (GMT) (envelope-from kapiltj@yahoo.com) Received: (qmail 83895 invoked by uid 60001); 26 Apr 2006 02:21:24 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=M4ZxCwHOhfdFYrDNNYJDb3sZL+itkrJ2HgIXJzVuTTC6r5RWu9sYlCN6fpV1/sk4j2YtGMI6crMDXSgAK0U5lVcbht62mLAwKS4YNOA2ThIN1Gxn+zH8cQLiGkG7N9MNakrPiecvBeiynWF8LSYPDMCp498+VLsw6IBmfhpxD8o= ; Message-ID: <20060426022124.83893.qmail@web81106.mail.mud.yahoo.com> Received: from [66.129.224.36] by web81106.mail.mud.yahoo.com via HTTP; Tue, 25 Apr 2006 19:21:24 PDT Date: Tue, 25 Apr 2006 19:21:24 -0700 (PDT) From: kapil jain To: Erik Trulsson In-Reply-To: <20060425223220.GA90792@owl.midgard.homeip.net> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 26 Apr 2006 02:43:23 +0000 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Wed, 26 Apr 2006 02:21:25 -0000 Thanks Erik. Yes, the shared memory in this case is double counted, which means more than 75M is unacccounted for. So if I understand correctly, the resident set size of all processes would be: active < RSS < active + inactive? And all the kernel memory is included in the wired part (there may be some user space memory there if it is mlocked), none is in active or inactive. Erik Trulsson wrote: 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