[Qa-jenkins-scm] [jenkins.debian.net] 01/01: instruct java to store heap dumps in case of OOM
Mattia Rizzolo
mattia at debian.org
Thu Sep 8 15:38:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch master
in repository jenkins.debian.net.
commit 6f7a081d9f2c37532ce0c7f2e83a4224fc2440b5
Author: Mattia Rizzolo <mattia at debian.org>
Date: Thu Sep 8 15:23:28 2016 +0000
instruct java to store heap dumps in case of OOM
---
hosts/jenkins/etc/default/jenkins | 2 +-
hosts/jenkins/etc/init.d/jenkins | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/hosts/jenkins/etc/default/jenkins b/hosts/jenkins/etc/default/jenkins
index ecf2a20..615b35f 100644
--- a/hosts/jenkins/etc/default/jenkins
+++ b/hosts/jenkins/etc/default/jenkins
@@ -10,7 +10,7 @@ JAVA=/usr/bin/java
#JAVA_ARGS="-Djava.awt.headless=true" # Allow graphs etc. to work even when an X server is present
#JAVA_ARGS="-Xmx256m"
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true" # make jenkins listen on IPv4 address
-JAVA_ARGS="-Djava.awt.headless=true -Xmx3072m -XX:MaxPermSize=384m"
+JAVA_ARGS="-Djava.awt.headless=true -Xmx3072m -XX:MaxPermSize=384m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/jenkins/heapDumps/"
PIDFILE=/var/run/$NAME/$NAME.pid
diff --git a/hosts/jenkins/etc/init.d/jenkins b/hosts/jenkins/etc/init.d/jenkins
index 2714eb1..4b266c4 100755
--- a/hosts/jenkins/etc/init.d/jenkins
+++ b/hosts/jenkins/etc/init.d/jenkins
@@ -92,6 +92,11 @@ check_tcp_port() {
#
do_start()
{
+ # java will store heap dumps here in case of OutOfMemoryError.
+ # delete old heap dumps when starting
+ rm -r "$JENKINS_HOME/heapDumps/" > /dev/null 2>&1 || true
+ mkdir -p "$JENKINS_HOME/heapDumps/"
+ chown ${JENKINS_USER}.${JENKINS_GROUP} "$JENKINS_HOME/heapDumps"
# the default location is /var/run/jenkins/jenkins.pid but the parent directory needs to be created
mkdir `dirname $PIDFILE` > /dev/null 2>&1 || true
chown $JENKINS_USER `dirname $PIDFILE`
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list