Calculating Dirty Memory
Lacey Powers
lacey.leanne at gmail.com
Mon Jan 12 23:10:33 UTC 2015
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
More information about the freebsd-questions
mailing list