Skip to content

Instantly share code, notes, and snippets.

@ikuwow
Last active September 20, 2015 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikuwow/9ba6c94129770389bd58 to your computer and use it in GitHub Desktop.
Save ikuwow/9ba6c94129770389bd58 to your computer and use it in GitHub Desktop.
簡便なSafariとChromeのメモリ使用量の測定方法 ref: http://qiita.com/ikuwow/items/976166b30610f33f4643
$ sh safari_vs_chrome.sh &
$ tail -f safari_vs_chrome.log
2015-04-05 11:04:14 926424 874976
2015-04-05 11:04:15 926372 874972
2015-04-05 11:04:17 926380 874952
2015-04-05 11:04:18 926412 874952
2015-04-05 11:04:19 926456 874952
Date Safari Chrome
2015-04-05 11:04:20 926536 874952
2015-04-05 11:04:21 926484 874944
2015-04-05 11:04:22 926628 874960
(以下続く)
#!/bin/bash
logfile="./safari_vs_chrome.log"
while sleep 1; do
now=`date +%S`
surplus=`expr $now % 10`
if [ $surplus -eq 0 ];then
echo 'Date Safari Chrome' > $logfile
fi
echo `date "+%Y-%m-%d %H:%M:%S"` \
`ps aux | grep Safari | awk '{sum += \$6}END{print sum}'` \
`ps aux | grep Chrome | awk '{sum += \$6}END{print sum}'` > $logfile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment