A question about using "vmstat" to get the memory use info of kernel

Nan Xiao nan at chinadtrace.org
Wed Aug 3 02:00:52 UTC 2016


Hi all,

My FreeBSD is installed on VMWare Virtual Machine of my desktop, and the version is as follows:  

# uname -a
FreeBSD FreeBSD 10.3-RELEASE-p5 FreeBSD 10.3-RELEASE-p5 #0: Tue Jul 19 17:52:57 CST 2016     root at FreeBSD:/usr/obj/usr/src/sys/NAN_FIRST_BUILD  amd64

I have installed a "hello" driver, and use "vmstat" command to check its buffer info:  

# vmstat -m | head -n 1 && vmstat -m | grep "hello"
         Type InUse MemUse HighUse Requests  Size(s)
 hello_buffer     1     1K       -        1  256
# vmstat -m | head -n 1 && vmstat -m | grep "hello"
         Type InUse MemUse HighUse Requests  Size(s)
 hello_buffer     1     1K       -        1  256
# vmstat -m | head -n 1 && vmstat -m | grep "hello"
         Type InUse MemUse HighUse Requests  Size(s)
# vmstat -m | head -n 1 && vmstat -m | grep "hello"
         Type InUse MemUse HighUse Requests  Size(s)
 hello_buffer     1     1K       -        1  256

I execute "vmstat -m | head -n 1 && vmstat -m | grep "hello"" command 4 times continuously, but the outputs are different. I am sure the "hello" module
is idle during the time. Why does the command output differently?

Thanks very much in advance!


Best Regards
Nan Xiao (肖楠)
Skype: xiaonan19830818
Jabber/XMPP: nanxiao at xmpp.ru.net 
Telegram: nanxiao
Personal website (Chinese): http://nanxiao.me/ 
Personal website (English): http://nanxiao.me/en 
Chinese DTrace website: http://chinadtrace.org/


More information about the freebsd-questions mailing list