/tmp/mon_tmp10.txt#free memoryv=`cat /tmp/mon_tmp10.txt|awk '{print $13}' ... LoveUnix AIX,UNIX,LINUX,DB2,TSM,POWER 企业级技术学习论坛 - Discuz! Archiver">
LoveUnix » 编程开发 & Rational » 取FREE MEMORY 的shell
让LU留住您的每

一天 让LU博客留住您的每一天
2008-1-21 18:38 babyzhou
取FREE MEMORY 的shell

#取FREE MEMORY
iostat 1 2 > /tmp/mon_tmp12.txt &
echo `vmstat 1 2|grep -v System|awk '{print $4 "  "$6" "$7" "$16 " " $17}'` >/tmp/mon_tmp10.txt
#free memory
v=`cat /tmp/mon_tmp10.txt|awk '{print $13}'`
let mem_free=v*4

more  /tmp/mon_tmp10.txt
faults ------------ fre pi po id wa 39991 0 0 75 0 39990 0 0 74 0

cat /tmp/mon_tmp10.txt|awk '{print $13}'
39990

let mem_free=v*4
不明白这里*4用意是什么?这种取FREE MEMORY不知道逻辑对不对:lu4:

[[i] 本帖最后由 babyzhou 于 2008-1-21 18:49 编辑 [/i]]

2008-1-21 20:51 babyzhou
每页4K大小???
39990*4=159960K
159960/1024=156M???
该主机有16G的内存,难道16G的内存,空闲的内存只有156M,不太可能啊,这台主的业务不忙的,资源还不错的

页: [1]
查看完整版本: 取FREE MEMORY 的shell


Powered by Discuz! Archiver 5.5.0  © 2001-2006 Comsenz Inc.