Free memory

From TykWiki
Revision as of 11:54, 14 August 2010 by Tykling (talk | contribs) (Created page with '<pre> PAGES_FREE=`sysctl -n vm.stats.vm.v_free_count` PAGES_INACTIVE=`sysctl -n vm.stats.vm.v_inactive_count` PAGES_CACHE=`sysctl -n vm.stats.vm.v_cache_count` PAGES_LIBRES=`expr…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
PAGES_FREE=`sysctl -n vm.stats.vm.v_free_count`
PAGES_INACTIVE=`sysctl -n vm.stats.vm.v_inactive_count`
PAGES_CACHE=`sysctl -n vm.stats.vm.v_cache_count`
PAGES_LIBRES=`expr ${PAGES_FREE} + ${PAGES_INACTIVE} + ${PAGES_CACHE}`
TAILLE_PAGES=`sysctl -n vm.stats.vm.v_page_size`
MEMOIRE_LIBRE=`expr ${PAGES_LIBRES} \* ${TAILLE_PAGES} / 1048576`
echo "${MEMOIRE_LIBRE}M free memory"

Thanks to Hubert Tournier in http://lists.freebsd.org/pipermail/freebsd-emulation/2010-August/007935.html