what sysctl entry shows the amount of RAM used for disk buffers?

Hi all, according to an article I read a while ago (but can't find now), FreeBSD memory is divided up into
  1. Active - memory used by applications.
  2. Inactive - memory that has been but still has data in it.
  3. Wired - memory used by the kernel that cannot be swapped out.
  4. Cache - memory used to cache data for applications.
  5. Buffers - memory used as a disk cache.
  6. Free - memory that is free to be used.
I dug through sysctl and found values for all of those except Buffers. Is there a sysctl value I can check for Buffers?

I want this because I've been fiddling with RRDTool and have a small VM that is nicely graphing memory usage for me except for the buffers value.
ram.png
 
/usr/src/usr.bin/top/machine.c is a nice way to know where top(1) gets its values from. So, apparently, it's vfs.bufspace, but that seems to be always 0 on my systems using ZFS, so if you do that as well, you might want to use ARC related stats as well.

Code:
                GETSYSCTL("vfs.bufspace", bufspace);
                GETSYSCTL("vm.stats.vm.v_active_count", memory_stats[0]);
                GETSYSCTL("vm.stats.vm.v_inactive_count", memory_stats[1]);
                GETSYSCTL("vm.stats.vm.v_laundry_count", memory_stats[2]);
                GETSYSCTL("vm.stats.vm.v_wire_count", memory_stats[3]);
                GETSYSCTL("vm.stats.vm.v_free_count", memory_stats[5]);
                GETSYSCTL("vm.stats.vm.v_swappgsin", nspgsin);
                GETSYSCTL("vm.stats.vm.v_swappgsout", nspgsout);
 
Back
Top