Skip to content

Commit

Permalink
Merge pull request #382 from oracle/issue-379
Browse files Browse the repository at this point in the history
Issue 379
  • Loading branch information
thegridman authored Dec 19, 2019
2 parents 9b2727b + 7262bfc commit 6cdf358
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
8 changes: 6 additions & 2 deletions helm-charts/coherence/scripts/startCoherence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ start()

MEM_OPTS="-XX:HeapDumpPath=${JVM_DIR}/heap-dumps/${COH_MEMBER_NAME}-${COH_POD_UID}.hprof"
COH_JVM_ARGS="-Dcoherence.ttl=0 -XshowSettings:all -XX:+PrintCommandLineFlags -XX:+PrintFlagsFinal \
-XX:+UnlockDiagnosticVMOptions -XX:+UnlockCommercialFeatures -XX:+UnlockExperimentalVMOptions \
-XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions \
-XX:ErrorFile=${JVM_DIR}/hs-err-${COH_MEMBER_NAME}-${COH_POD_UID}.log"

if [[ "${JVM_JMXMP_ENABLED}" == "true" ]]
Expand Down Expand Up @@ -298,7 +298,11 @@ start()

if [[ "${JVM_FLIGHT_RECORDER}" == "true" ]]
then
COH_JVM_ARGS="${COH_JVM_ARGS} -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexitpath=${JVM_DIR}/jfr"
${JAVA_HOME}/bin/java -cp ${COH_UTIL_DIR}/lib/* com.oracle.coherence.k8s.JvmInfo java.vm.name | grep HotSpot
if [[ "$?" == "0" ]]
then
COH_JVM_ARGS="${COH_JVM_ARGS} -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexitpath=${JVM_DIR}/jfr"
fi
fi

if [[ "${JVM_USE_CONTAINER_LIMITS}" == "true" ]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/

package com.oracle.coherence.k8s;

/**
* Determine the JVM information.
*/
public class JvmInfo {

private JvmInfo() {
}

/**
* Program entry point.
*
* @param args the program command line arguments
*/
public static void main(String[] args) {
if (args.length > 0) {
System.out.println(System.getProperty(args[0]));
}
}
}

0 comments on commit 6cdf358

Please sign in to comment.