Omaha #3227 - Add memory check to capture script
Change-Id: Icce56d22be3c785ccfe41903b01eabdbe49c5475 Former-commit-id:5b1f81551c
[formerly 2d72889bf873c08cef82b2dd01f91e14d04ddc62] Former-commit-id:fc88788547
This commit is contained in:
parent
eaa8958ce2
commit
87c4971f59
1 changed files with 22 additions and 1 deletions
|
@ -135,6 +135,21 @@ checkYes() {
|
|||
fi
|
||||
}
|
||||
|
||||
#check if at least 1 GB of free mem exists to run jmap
|
||||
checkJmapMem() {
|
||||
CAP_MEM=1000
|
||||
let freeMem=`free -m |grep buffers/cache|awk '{print $4}'`
|
||||
|
||||
if [ $freeMem -gt $CAP_MEM ]; then
|
||||
echo "${t1}: ${freeMem}M free, running jmap" >> $processFile
|
||||
return 1
|
||||
else
|
||||
echo "${t1}: ${freeMem}M free, skipping jmap" >> $processFile
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# runs import to grab screen shot of users desktop
|
||||
grabScreenShot() {
|
||||
if [ "$GRAB_SCREENSHOT" == "y" ]; then
|
||||
|
@ -561,7 +576,13 @@ if [ ! -z "${myProcs}" ]; then
|
|||
IFS=$PREV_IFS
|
||||
|
||||
launchJstacks
|
||||
launchJmaps
|
||||
|
||||
checkJmapMem
|
||||
let rc=$?
|
||||
if [ $rc -eq 1 ]; then
|
||||
launchJmaps
|
||||
fi
|
||||
|
||||
else
|
||||
t1=`date "+%Y%m%d %H:%M:%S"`
|
||||
echo "*** NO processes found for user $user, capturing limited data to $dataPath"
|
||||
|
|
Loading…
Add table
Reference in a new issue