From owner-freebsd-questions@FreeBSD.ORG Wed Mar 7 15:17:09 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37BF0106564A for ; Wed, 7 Mar 2012 15:17:09 +0000 (UTC) (envelope-from luke-lists@hybrid-logic.co.uk) Received: from hybrid-sites.com (ns226322.hybrid-sites.com [176.31.229.137]) by mx1.freebsd.org (Postfix) with ESMTP id ECC708FC15 for ; Wed, 7 Mar 2012 15:17:08 +0000 (UTC) Received: from [127.0.0.1] (helo=ewes) by hybrid-sites.com with esmtp (Exim 4.72 (FreeBSD)) (envelope-from ) id 1S5Ibt-000Jxi-0T; Wed, 07 Mar 2012 15:17:06 +0000 Received: from [193.37.225.212] (helo=[10.0.126.148] by ns226322.hybrid-sites.com with esmtp (Hybrid Web Cluster distributed mail proxy) (envelope-from ); Wed, 07 Mar 2012 15:17:01 -0000 From: Luke Marsden To: J B In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Wed, 07 Mar 2012 15:16:57 +0000 Message-ID: <1331133417.2589.101.camel@pow> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit X-Spam-bar: + Cc: tech@hybrid-logic.co.uk, freebsd-questions@freebsd.org Subject: Re: FreeBSD 8.2 - active plus inactive memory leak!? 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, 07 Mar 2012 15:17:09 -0000 On Wed, 2012-03-07 at 13:33 +0100, J B wrote: > On Wed, 07 Mar 2012 10:23:38 +0200, Konstantin Belousov wrote: > > > On Wed, Mar 07, 2012 at 12:36:21AM +0000, Luke Marsden wrote: > > ... > >> I'm trying to confirm that, on a system with no pages swapped out, that > >> the following is a true statement: > >> > >> a page is accounted for in active + inactive if and only if it > >> corresponds to one or more of the pages accounted for in the > >> resident memory lists of all the processes on the system (as > >> per the output of 'top' and 'ps') > > No. > > > > The pages belonging to vnode vm object can be active or inactive or > > cached but not mapped into any process address space. > > I wonder if some ideas by Denys Vlasenko contained in this thread > http://comments.gmane.org/gmane.linux.redhat.fedora.devel/157706 > would be useful ? https://github.com/pixelb/scripts/blob/master/scripts/ps_mem.py This looks like a really useful script, and looks like it works under FreeBSD with linprocfs. Good find! Cheers, Luke > ... > "Today, I'm looking at my process list, sorted by amount of dirtied pages > (which very closely matches amount of malloced and used space - that is, > malloced, but not-written to memory areas are not included). > This is the most expensive type of pages, they can't be discarded. > If we would be in memory squeeze, kernel will have to swap them out, > if swap exists, otherwise kernel can't do anything at all." > ... > "Note that any shared pages (such as glibc) are not freed this way; > also, non-mapped pages (such as large, but unused malloced space, or large, > but unused file mappings) also do not contribute to MemFree increase." > > jb -- CTO, Hybrid Logic +447791750420 | +1-415-449-1165 | www.hybrid-cluster.com