[zz]Troubleshooting Memory Usage
程序员文章站
2022-07-14 14:12:07
...
http://rimuhosting.com/howto/memory.jsp
# create a memmon.sh script that tracks the current date, memory usage and running processes cat << EOF > /root/memmon.sh #!/bin/bash date; uptime free -m vmstat 1 5 ps auxf --width=200 if which iptables 2>&1 > /dev/null; then iptables -L | diff iptables_default - | awk '{print "IPTABLES: " $0}' iptables -L > iptables_default else echo "IPTABLES MISSING" fi dmesg | diff -u dmesg_default - | grep '^+' | awk '{print "DMESG:" $0}' dmesg > dmesg_default EOF chmod +x /root/memmon.sh # create a cronjob that runs every few minutes to log the memory usage echo '0-59/10 * * * * root /root/memmon.sh >> /root/memmon.txt' > /etc/cron.d/memmon /etc/init.d/cron* restart # create a logrotate entry so the log file does not get too large echo '/root/memmon.txt {}' > /etc/logrotate.d/memmon
上一篇: 自动化解决编译依赖问题
下一篇: 在二进制程序中留下对应源代码的版本号
推荐阅读
-
PHP通过内置函数memory_get_usage()获取内存使用情况
-
[zz]Troubleshooting Memory Usage
-
[zz]Troubleshooting Memory Usage
-
PHP管理内存函数 memory_get_usage()使用介绍
-
采用PHP函数memory_get_usage获取PHP内存清耗量的方法
-
PHP通过内置函数memory_get_usage()获取内存使用情况
-
如何获知PHP程序占用多少内存(memory_get_usage)
-
采用PHP函数memory_get_usage获取PHP内存清耗量的方法_PHP教程
-
php函数memory_get_usage() 查看当前分配给PHP 脚本的内存
-
memory_get_usage 疑问