Nokia / freebsb memory utilization calculation

From thelinuxwiki
Revision as of 15:41, 24 May 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Formula

% utilization =    used  memory / total  =  
total – available / total =  
hw.physmem – ((vm.stats.vm.v_inactive_count * hw.pagesize) + (vm.stats.vm.v_cache_count * hw.pagesize) + (vm.stats.vm.v_free_count * hw.pagesize))  / hw.physmem 

commands to gather memory data

sysctl -a | grep vm.stats.vm.v_inactive_count
sysctl -a | grep vm.stats.vm.v_cache_count
sysctl -a | grep vm.stats.vm.v_free_count
sysctl -a | grep  hw.pagesize
sysctl -a | grep hw.physmem


Links

http://www.cyberciti.biz/files/scripts/freebsd-memory.pl.txt