Former code behaved badly when `pgrep qemu` was empty.
Thanks to lihuang of BZ#609016
---
ksmtuned | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ksmtuned b/ksmtuned
index 205ff84..d5d1494 100644
--- a/ksmtuned
+++ b/ksmtuned
@@ -71,8 +71,8 @@ KSMCTL () {
committed_memory () {
# calculate how much memory is committed to running qemu processes
local progname
- progname=${1:-qemu}
- ps -o vsz `pgrep $progname` | awk '{ sum += $1 }; END { print sum }'
+ progname=${1:-qemu-kvm}
+ ps -C "$progname" -o rsz | awk '{ sum += $1 }; END { print sum }'
}
free_memory () {
--
1.7.2.1
Show replies by date