From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 10 16:42:47 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 45374CA4 for ; Wed, 10 Oct 2012 16:42:47 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id ECC948FC08 for ; Wed, 10 Oct 2012 16:42:46 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fw7so1296566vcb.13 for ; Wed, 10 Oct 2012 09:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=WQtYJzGsYuj7puhxEnEntVwMPFE4PvRkDWMajnzmoW0=; b=WwM6x0eDL30fF7ZpmFz3UUknEWNh38+fqwaNrPFVFBF4ccIAQDnPFzo745/vUmVrct nAW/QcFp6PSjUyVz/qTuXEuxKqtKv662D7Zjl2IoK1EwyO8ZBjJz9qvhFpVgexYjNH2o J8fc+ddajWGS8ahRyn0kEFZ/sSsQ3SDAK64G6JKFVPsBaz+5nzpWwNR0kVoatJgdNbor fgzDVjzs0moBbv4EkIJfOOcDIfnRmMBg6C2QQQHDOrox7Nzb6tYt8v6jSyWm0VKw3oJm ncpgTzBrQSB+fJChEEPIAApRkCikqMqm2S7HC+eN1Rfy6wzVAO67duUj1UtrEw/lWlB1 +VPg== MIME-Version: 1.0 Received: by 10.52.29.74 with SMTP id i10mr5850740vdh.40.1349887366025; Wed, 10 Oct 2012 09:42:46 -0700 (PDT) Received: by 10.58.207.114 with HTTP; Wed, 10 Oct 2012 09:42:45 -0700 (PDT) In-Reply-To: <1349746003.10434.YahooMailClassic@web181706.mail.ne1.yahoo.com> References: <1349746003.10434.YahooMailClassic@web181706.mail.ne1.yahoo.com> Date: Wed, 10 Oct 2012 12:42:45 -0400 Message-ID: Subject: Re: Kernel memory usage From: Ryan Stone To: Sushanth Rai Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 16:42:47 -0000 On Mon, Oct 8, 2012 at 9:26 PM, Sushanth Rai wrote= : > I was trying to co-relate the o/p from "top" to that I get from vmstat -z= . I don't have any user programs that wires memory. Given that, I'm assumin= g the wired memory count shown by "top" is memory used by kernel. Now I wou= ld like find out how the kernel is using this "wired" memory. So, I look at= dynamic memory allocated by kernel using "vmstat -z". I think memory alloc= ated via malloc() is serviced by zones if the allocation size is <4k. So, I= 'm not sure how useful "vmstat -m" is. I also add up memory used by buffer = cache. Is there any other significant chunk I'm missing ? Does vmstat -m sh= ow memory that is not accounted for in vmstat -z. All allocations by malloc that are larger than a single page are served by uma_large_malloc, and as far as I can tell these allocations will not be accounted for in vmstat -z (they will, of course, be accounted for in vmstat -m). Similarly, all allocations through contigmalloc will not be accounted for in vmstat -z.