From owner-freebsd-stable@FreeBSD.ORG Sat Sep 4 06:09:52 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 010CE16A4CE for ; Sat, 4 Sep 2004 06:09:52 +0000 (GMT) Received: from VARK.homeunix.com (SYDNEYPACIFIC-SIX-EIGHTY-SIX.MIT.EDU [18.95.7.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E51843D2F for ; Sat, 4 Sep 2004 06:09:51 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.13.1/8.12.10) with ESMTP id i8469dbf024403; Fri, 3 Sep 2004 23:09:39 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.13.1/8.12.10/Submit) id i8469d9T024402; Sat, 4 Sep 2004 02:09:39 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sat, 4 Sep 2004 02:09:39 -0400 From: David Schultz To: "Marc G. Fournier" Message-ID: <20040904060939.GA24232@VARK.homeunix.com> References: <20040831205907.O31538@ganymede.hub.org> <20040831214524.P31538@ganymede.hub.org> <20040831215959.D31538@ganymede.hub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040831215959.D31538@ganymede.hub.org> cc: freebsd-stable@FreeBSD.ORG Subject: Re: vnodes - is there a leak? where are they going? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Sep 2004 06:09:52 -0000 On Tue, Aug 31, 2004, Marc G. Fournier wrote: > > Hrmmm, maybe I'm mis-reading all of this, and going down the wrong paths > here, so hopefully someone will correct if I am ... but, for now ... > > Looking at vmstat -m a bit further, the top of the report has: > > Memory statistics by bucket size > Size In Use Free Requests HighWater Couldfree > 16 13116 28356 2063580697 1280 7822 > 32 77734 7002 168084205 640 316065 > 64 465006 48402 2804541088 320 637084 > 128 100182 60010 591859866 160 1850304 > 256 500029 12163 1178322001 80 123078 > > Now, the only things that are using alot of the '256 Size' memory are: > > FFS node494513123629K 127870K204800K401104542 0 0 256 > vfscache449709 29178K 32434K204800K737673766 0 0 > 64,128,256,512K > > Since only 500029 are 'InUse', and since FFS node is exclusively 256 ... > I'm going to guess that most of vfscache is using something else ... so, > my question becomes if 123000 'Could be Freed', why aren't they? CouldFree isn't a count of free chunks---it's a count of the number of times the system would have liked to free a page, but couldn't due to fragmentation. Kernel malloc() works by allocating pages, then subdividing those pages into buckets whose sizes are powers of 2. It is sometimes the case that there are many free buckets, but they are spread across multiple pages, all of which have at least one allocated bucket. This causes the CouldFree count to go up. But this isn't really relevant to your problem; a little bit of fragmentation isn't a big deal because the memory generally just gets reused on subsequent calls to malloc().