Omaha #3227 - Add memory check to capture script
Change-Id: Icce56d22be3c785ccfe41903b01eabdbe49c5475 Former-commit-id: 2d72889bf873c08cef82b2dd01f91e14d04ddc62
This commit is contained in:
parent
f75a57ac23
commit
fc88788547
1 changed files with 22 additions and 1 deletions
|
@ -135,6 +135,21 @@ checkYes() {
|
||||||
fi
|
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
|
# runs import to grab screen shot of users desktop
|
||||||
grabScreenShot() {
|
grabScreenShot() {
|
||||||
if [ "$GRAB_SCREENSHOT" == "y" ]; then
|
if [ "$GRAB_SCREENSHOT" == "y" ]; then
|
||||||
|
@ -561,7 +576,13 @@ if [ ! -z "${myProcs}" ]; then
|
||||||
IFS=$PREV_IFS
|
IFS=$PREV_IFS
|
||||||
|
|
||||||
launchJstacks
|
launchJstacks
|
||||||
|
|
||||||
|
checkJmapMem
|
||||||
|
let rc=$?
|
||||||
|
if [ $rc -eq 1 ]; then
|
||||||
launchJmaps
|
launchJmaps
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
t1=`date "+%Y%m%d %H:%M:%S"`
|
t1=`date "+%Y%m%d %H:%M:%S"`
|
||||||
echo "*** NO processes found for user $user, capturing limited data to $dataPath"
|
echo "*** NO processes found for user $user, capturing limited data to $dataPath"
|
||||||
|
|
Loading…
Add table
Reference in a new issue