From owner-freebsd-stable@FreeBSD.ORG Thu May 31 20:15:38 2007 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B065016A421 for ; Thu, 31 May 2007 20:15:38 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.226]) by mx1.freebsd.org (Postfix) with ESMTP id 5653013C4C6 for ; Thu, 31 May 2007 20:15:38 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by wr-out-0506.google.com with SMTP id 69so264639wra for ; Thu, 31 May 2007 13:15:37 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to; b=K8fsHIKu4i5j9s41kCnXLQOF6izO9q1M6sjOS4c/AfP+mWcqMqdo6v3Xjt5KwecSv1AxiaERRmzqn2zmLYnZwvoWvuI2uQOa0EPQj07Nr/FqbIhAUPd9Q80L1/P0JOel+c7n0bVMhLpRLybLpPiDv0Zrez9/WKVNADz/JqAG0GQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to; b=D48+HwPwly6/Rx+sLEk/HaI4Yg9BVu4yNpIQ+GMyn3sIMqPNmhUiGMNV8oW746SWxtwCB8npFvjUJpf6cOhzvhYlhUNt0324JIEbFJwthl+Pug854MLXurIwAPUuostxii0t3mOiBrOsHx5nZAkCQbSk6Md5WXuq1Ps+zAHIbSI= Received: by 10.82.176.3 with SMTP id y3mr449025bue.1180642536314; Thu, 31 May 2007 13:15:36 -0700 (PDT) Received: from roadrunner.q.local ( [85.180.174.137]) by mx.google.com with ESMTP id w5sm5123693mue.2007.05.31.13.15.35; Thu, 31 May 2007 13:15:35 -0700 (PDT) Received: from roadrunner.q.local (localhost [127.0.0.1]) by roadrunner.q.local (8.14.1/8.14.1) with ESMTP id l4VK91hO016217; Thu, 31 May 2007 22:09:01 +0200 (CEST) (envelope-from uspoerlein@gmail.com) Received: (from q@localhost) by roadrunner.q.local (8.14.1/8.14.1/Submit) id l4VK90TB016216; Thu, 31 May 2007 22:09:00 +0200 (CEST) (envelope-from uspoerlein@gmail.com) Date: Thu, 31 May 2007 22:09:00 +0200 From: Ulrich Spoerlein To: Peter Jeremy Message-ID: <20070531200900.GB14269@roadrunner.q.local> Mail-Followup-To: Peter Jeremy , stable@freebsd.org References: <20070528092905.GB1551@roadrunner.q.local> <20070528100752.GA1750@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070528100752.GA1750@turion.vk2pj.dyndns.org> Cc: stable@freebsd.org Subject: Re: Change in memory tracking in recent 6-STABLE? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2007 20:15:39 -0000 Peter Jeremy wrote: > On 2007-May-28 11:29:05 +0200, Ulrich Spoerlein wrote: > >I'm using symon to monitor memory usage among several FreeBSD machines. > >After updating to a recent 6-STABLE, the amount of memory no longer adds > >up to the total physical memory. The "inactive" counter is way too > >small. > > As well as "active", "inactive" and "free", there is "cache", "wired" > and "buffers". > > Check the following sysctls: > vfs.bufspace (bytes) > vm.stats.vm.v_active_count (pages) > vm.stats.vm.v_inactive_count (pages) > vm.stats.vm.v_wire_count (pages) > vm.stats.vm.v_cache_count (pages) > vm.stats.vm.v_free_count (pages) Hi Peter, Ok, adding up vm.stats gives me the total physical RAM (roughly). One question would be, where is the buffer cache counted towards? Or is it spread all over the place? Back to symon, it uses the following code to grab it's values. This has worked fine till some months ago. Now it is missing several MBytes. How should I fix the code? static int me_vm_mib[] = {CTL_VM, VM_TOTAL}; ... if (sysctl(me_vm_mib, 2, &me_vmtotal, &me_vmsize, NULL, 0) < 0) { warning("%s:%d: sysctl failed", __FILE__, __LINE__); bzero(&me_vmtotal, sizeof(me_vmtotal)); } /* convert memory stats to Kbytes */ me_stats[0] = pagetob(me_vmtotal.t_arm); me_stats[1] = pagetob(me_vmtotal.t_rm); me_stats[2] = pagetob(me_vmtotal.t_free); Why are these values not adding up to 256MB in my case? Ulrich Spoerlein -- "The trouble with the dictionary is you have to know how the word is spelled before you can look it up to see how it is spelled." -- Will Cuppy