From owner-freebsd-questions@FreeBSD.ORG Thu Oct 15 07:17:34 2009 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 B72581065676 for ; Thu, 15 Oct 2009 07:17:34 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id 537918FC1A for ; Thu, 15 Oct 2009 07:17:33 +0000 (UTC) Received: by ewy18 with SMTP id 18so546399ewy.43 for ; Thu, 15 Oct 2009 00:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=4SMWpAdenFtclCWH9ZcZvmAhPRUWGzp0pCdgptmvnXA=; b=BxKzb3MPAUBSxtQug4YKAxsOUPx9U2T/w5clXF9rxng77Zag2l+u2UksWGQ/mzRzqg FOx/HDko7txV0F4LgCIFPx3vo6hPZjSuy+eOYmQLPInRlAX+pa+cEdltD4mQ5614OCmD 8nBAHmW7Riqy7c0IMcQL5PBo+AY0i6WISiAlo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=IzeqEwHIiKes2G1GIfdoq2xS2++Eq1+nxWRWj04ootXkJMORjsXvXedEZGlzf33O/F DMEf/1+Vj3yzZqICJ4S8etX7rO28bKCRMqQLT0WxJ30dJEcv0knM8moaRr9uyb0ymkm8 sQBNHadiYbMRsmvrFT3dcMmj6gRhIXroYtL9o= MIME-Version: 1.0 Received: by 10.211.132.37 with SMTP id j37mr4802253ebn.76.1255589742701; Wed, 14 Oct 2009 23:55:42 -0700 (PDT) Date: Thu, 15 Oct 2009 02:55:42 -0400 Message-ID: From: grarpamp To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Adding up kernel mem usage 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: Thu, 15 Oct 2009 07:17:34 -0000 If I subtract vmstat and kldstat from wired, I'm missing approx 100M. What am I doing wrong or what should I be adding up to find the total mem in use by the kernel and a breakdown of that usage? Thanks. top -SH -d 1 1000 | egrep '^Mem:' Mem: 114M Active, 65M Inact, 258M Wired, 468K Cache, 46M Buf, 551M Free vmstat -m | sed -E 's,^(.............),,' | awk '{print $2}' | sed 's,K,,' | egrep -v MemUse | add 143920 { printf 'ibase=16\n' ; kldstat | tr '[:lower:]' '[:upper:]' | egrep -v SIZE | awk '{print $4}' | tr '\n' '\+' | sed 's,+$,,' ; } | bc 13986028 vmstat procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad0 ad4 in sy cs us sy id 1 0 0 461M 551M 68 0 0 0 88 0 0 0 26 1189 654 3 1 97