Date: Sat, 4 Sep 2004 02:09:39 -0400 From: David Schultz <das@FreeBSD.ORG> To: "Marc G. Fournier" <scrappy@hub.org> Cc: freebsd-stable@FreeBSD.ORG Subject: Re: vnodes - is there a leak? where are they going? Message-ID: <20040904060939.GA24232@VARK.homeunix.com> In-Reply-To: <20040831215959.D31538@ganymede.hub.org> References: <20040831205907.O31538@ganymede.hub.org> <20040831214524.P31538@ganymede.hub.org> <20040831215959.D31538@ganymede.hub.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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().
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040904060939.GA24232>