From e1c99bc8b4cdc1f218089c4a32538956f97df1cb Mon Sep 17 00:00:00 2001 From: Chris Earle Date: Wed, 17 Jun 2015 17:09:23 -0400 Subject: [PATCH] Add -XX:+PrintGCDateStamps when using GC Logs Now that Elasticsearch requires Java 7 or later, it's safe to add `-XX:+PrintGCDateStamps` to get human readable times alongside JVM times. --- distribution/src/main/resources/bin/elasticsearch.in.bat | 1 + distribution/src/main/resources/bin/elasticsearch.in.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/distribution/src/main/resources/bin/elasticsearch.in.bat b/distribution/src/main/resources/bin/elasticsearch.in.bat index b3eccc0a623..fdc5d82a649 100644 --- a/distribution/src/main/resources/bin/elasticsearch.in.bat +++ b/distribution/src/main/resources/bin/elasticsearch.in.bat @@ -64,6 +64,7 @@ if "%ES_GC_LOG_FILE%" == "" goto nogclog :gclog set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDetails set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCTimeStamps +set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDateStamps set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintClassHistogram set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintTenuringDistribution set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCApplicationStoppedTime diff --git a/distribution/src/main/resources/bin/elasticsearch.in.sh b/distribution/src/main/resources/bin/elasticsearch.in.sh index 631ec989215..86af7224604 100644 --- a/distribution/src/main/resources/bin/elasticsearch.in.sh +++ b/distribution/src/main/resources/bin/elasticsearch.in.sh @@ -48,6 +48,7 @@ JAVA_OPTS="$JAVA_OPTS -XX:+UseCMSInitiatingOccupancyOnly" if [ -n "$ES_GC_LOG_FILE" ]; then JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDetails" JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCTimeStamps" + JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDateStamps" JAVA_OPTS="$JAVA_OPTS -XX:+PrintClassHistogram" JAVA_OPTS="$JAVA_OPTS -XX:+PrintTenuringDistribution" JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCApplicationStoppedTime"