Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 2015 15:10:29 -0800
From:      Lacey Powers <lacey.leanne@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Calculating Dirty Memory
Message-ID:  <54B45465.7040501@gmail.com>

next in thread | raw e-mail | index | archive | help
Hello Everyone,

I was working on trying to improve some database benchmarking tools for 
PostgreSQL, to work better on FreeBSD.

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:

"Dirty — The total amount of memory, in kilobytes, waiting to be written 
back to the disk." according to the CentOS documentation and other sources.

Poking around the FreeBSD documentation, Google, and sysctls, I came to 
this calculation:

(vm.stats.vm.v_page_size * vm.stats.vm.v_inactive_count) / 1024 = 
Inactive (Dirty) kB  (page size in bytes *number of pages) / 1024

Based on notes from here:

https://www.freebsd.org/doc/en/articles/vm-design/article.html#freeing-pages

Does that seem correct? Is there a better way to determine this metric?

Thank you for your time and assistance,

Lacey



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54B45465.7040501>