From 609286643ce6bc2f99ace36266b5d6e36b91a7f8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 13 Oct 2005 21:03:48 +0000 Subject: Memory meter changes. Submitted-by: Dan Swartzendruber --- usr/local/www/includes/functions.inc.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'usr/local/www/includes/functions.inc.php') diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php index fca8335..1d7da59 100644 --- a/usr/local/www/includes/functions.inc.php +++ b/usr/local/www/includes/functions.inc.php @@ -128,13 +128,14 @@ function swap_usage() function mem_usage() { - exec("/sbin/sysctl -n vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count " . - "vm.stats.vm.v_wire_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count", $memory); + exec("/sbin/sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_inactive_count " . + "vm.stats.vm.v_cache_count vm.stats.vm.v_free_count", $memory); - $totalMem = $memory[0] + $memory[1] + $memory[2] + $memory[3] + $memory[4]; - $freeMem = $memory[4]; - $usedMem = $totalMem - $freeMem; + $totalMem = $memory[0]; + $availMem = $memory[1] + $memory[2] + $memory[3]; + $usedMem = $totalMem - $availMem; $memUsage = round(($usedMem * 100) / $totalMem, 0); return $memUsage; } + -- cgit v1.1