From owner-freebsd-questions@FreeBSD.ORG Tue Jan 13 01:41:58 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E8D7F9A for ; Tue, 13 Jan 2015 01:41:58 +0000 (UTC) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [IPv6:2a00:1450:400c:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F96BDE7 for ; Tue, 13 Jan 2015 01:41:58 +0000 (UTC) Received: by mail-we0-f178.google.com with SMTP id p10so235225wes.9 for ; Mon, 12 Jan 2015 17:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=cPwn5cI1OzHkU+Uyw4Uv87NppLPXaEUjtq1SUtijPdw=; b=pTkiShXQ8sNDtBQsTRIBvvukv+rCLjaFidCWjxisWJoS6q43Q6CSPSzJOU6OxkYgbh bYqEBZbdKA1KM4D+e+z632JM+7Bxt2Wxl32bIQl1rAe3kA6tx8Dvn4zPRHVoR6Lb6B61 rcum+XBqtByqfcyrrImLq6Tlf+j2vPIYQf6tHW/cAtDtrq28p2ox3ns9jNgVPuleh9MH KqyaMl2UVfZxh7Bka/hZ1PmVnqbAcyh4v34yxfg09nJd9Q59gvqVKxbl69dr/AMi6Puo Ki29MMcwjoVzyCig34IsX95KXBPIwvf0Y9y2MT/XEk72Szkjeqd4u7x2/+xGBbZIE0HR biYg== X-Received: by 10.180.90.16 with SMTP id bs16mr2226622wib.4.1421113315780; Mon, 12 Jan 2015 17:41:55 -0800 (PST) Received: from gumby.homeunix.com (5ec3c54b.skybroadband.com. [94.195.197.75]) by mx.google.com with ESMTPSA id gy8sm12247530wib.23.2015.01.12.17.41.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jan 2015 17:41:55 -0800 (PST) Date: Tue, 13 Jan 2015 01:41:51 +0000 From: RW To: freebsd-questions@freebsd.org Subject: Re: Calculating Dirty Memory Message-ID: <20150113014151.742c1aa1@gumby.homeunix.com> In-Reply-To: <54B45465.7040501@gmail.com> References: <54B45465.7040501@gmail.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.22; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2015 01:41:58 -0000 On Mon, 12 Jan 2015 15:10:29 -0800 Lacey Powers wrote: > Hello Everyone, >=20 > I was working on trying to improve some database benchmarking tools > for PostgreSQL, to work better on FreeBSD. >=20 > One of the things that the tools do under Linux is > read /proc/meminfo, and grab the value of the Dirty parameter, which > is this: >=20 > "Dirty ? The total amount of memory, in kilobytes, waiting to be > written back to the disk." according to the CentOS documentation and > other sources. AFAIK the word "dirty" can refer to any page that isn't synchronized with it's backing store, including swap-backed memory that may never be written to disk. > Poking around the FreeBSD documentation, Google, and sysctls, I came > to this calculation: >=20 > (vm.stats.vm.v_page_size * vm.stats.vm.v_inactive_count) / 1024 =3D=20 > Inactive (Dirty) kB (page size in bytes *number of pages) / 1024 v_inactive_count includes dirty and clean pages.