Error[8]: Undefined offset: 1, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

Linux内存泄漏检测shell脚本

本文实例为大家分享了Linux内存泄漏检测的shell脚本,供大家参考,具体内容如下

#!/bin/sh

if [ $# -ne 1 ]; then
  echo "Usage: `basename [+++]` process_name"
  exit 1
fi

APPNAME=
PROC="`ps -ef | grep "$APPNAME" | grep -v "grep" | grep -v "awk" | grep -v [+++] | awk '{print }'`"

if [ -z $PROC ]; then
  echo "invalid process_name"
  exit 1
fi

SMAPS="/proc/$PROC/smaps"
STATUS="/proc/$PROC/status"
echo "proc ---$PROC----"
OLDHEAP="0"
while :
do
  #HEAP="`cat $STATUS | grep "VmData" | awk '{print }'`"
  HEAP=`cat $SMAPS | grep -A 5 "heap" | grep "Rss" | awk '{print }'`
  if [ $HEAP -lt $OLDHEAP ]; then
    echo "`date` HEAP -`expr $OLDHEAP - $HEAP` to $HEAP kb"
    OLDHEAP=$HEAP
  elif [ $HEAP -gt $OLDHEAP ]; then
    echo "`date` HEAP +`expr $HEAP - $OLDHEAP` to $HEAP kb"
    OLDHEAP=$HEAP
  fi
  sleep 1
done

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 2, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

Linux内存泄漏检测shell脚本

本文实例为大家分享了Linux内存泄漏检测的shell脚本,供大家参考,具体内容如下

#!/bin/sh

if [ $# -ne 1 ]; then
  echo "Usage: `basename ` process_name"
  exit 1
fi

APPNAME=
PROC="`ps -ef | grep "$APPNAME" | grep -v "grep" | grep -v "awk" | grep -v [+++] | awk '{print }'`"

if [ -z $PROC ]; then
  echo "invalid process_name"
  exit 1
fi

SMAPS="/proc/$PROC/smaps"
STATUS="/proc/$PROC/status"
echo "proc ---$PROC----"
OLDHEAP="0"
while :
do
  #HEAP="`cat $STATUS | grep "VmData" | awk '{print }'`"
  HEAP=`cat $SMAPS | grep -A 5 "heap" | grep "Rss" | awk '{print }'`
  if [ $HEAP -lt $OLDHEAP ]; then
    echo "`date` HEAP -`expr $OLDHEAP - $HEAP` to $HEAP kb"
    OLDHEAP=$HEAP
  elif [ $HEAP -gt $OLDHEAP ]; then
    echo "`date` HEAP +`expr $HEAP - $OLDHEAP` to $HEAP kb"
    OLDHEAP=$HEAP
  fi
  sleep 1
done

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
` process_name&quo"og:type" content="webpage">` process_name&quo" /> ` process_name&quo"> Linux内存泄漏检测shell脚本_软件运维_内存溢出

阅读 61

Linux内存泄漏检测shell脚本,第1张

Linux内存泄漏

检测shell脚本 本文实例为大家分享了

Linux
内存泄漏检测的shell脚本,供大家参考,具体内容如下

#!/bin/sh if [ $# -ne 1 ]; then echo "Usage: `basename ` process_name" exit 1 fi APPNAME= PROC="`ps -ef | grep "$APPNAME" | grep -v "grep" | grep -v "awk" | grep -v | awk '{print }'`" if [ -z $PROC ]; then echo "invalid process_name" exit 1 fi SMAPS="/proc/$PROC/smaps" STATUS="/proc/$PROC/status" echo "proc ---$PROC----" OLDHEAP="0" while : do #HEAP="`cat $STATUS | grep "VmData" | awk '{print }'`" HEAP=`cat $SMAPS | grep -A 5 "heap" | grep "Rss" | awk '{print }'` if [ $HEAP -lt $OLDHEAP ]; then echo "`date` HEAP -`expr $OLDHEAP - $HEAP` to $HEAP kb" OLDHEAP=$HEAP elif [ $HEAP -gt $OLDHEAP ]; then echo "`date` HEAP +`expr $HEAP - $OLDHEAP` to $HEAP kb" OLDHEAP=$HEAP fi sleep 1 done

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

欢迎分享,转载请注明来源:

内存溢出

原文地址:

http://outofmemory.cn/yw/903847.html
内存泄漏
(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
code code 管理员组
linux尝试登录失败后锁定用户账户的两种方法
上一篇
2022-05-15
linux 命名管道实例详解
2022-05-15

发表评论
请登录后评论... 登录
提交

    评论列表(0条)
保存
{label} {label} ` process_name&quo', author : 'code', cat_name : '软件运维', time_y_m : '2022年05月', time_d : '15', site_motto : '内存溢出' }; {script} {script}