Merge "gerrit.sh: tell oom killer to respect us."

This commit is contained in:
Shawn Pearce 2010-12-07 08:40:11 -08:00 committed by Android Code Review
commit ac445e3a67

View File

@ -425,6 +425,17 @@ case "$ACTION" in
fi
fi
if test $UID = 0; then
PID=`cat "$GERRIT_PID"`
if test -f "/proc/${PID}/oom_score_adj" ; then
echo -1000 > "/proc/${PID}/oom_score_adj"
else
if test -f "/proc/${PID}/oom_adj" ; then
echo -16 > "/proc/${PID}/oom_adj"
fi
fi
fi
TIMEOUT=90 # seconds
sleep 1
while running "$GERRIT_PID" && test $TIMEOUT -gt 0 ; do