我们正在实现Jups EAP 7.1,其带有将Hiera和代码分离的puppet模块。我们使用以下命令
设置了最大和最小堆大小wildfly::java_xmx: '2048m'
wildfly::java_xms: '2048m'
我现在在{hiera代码中添加wildfly::java_opts: '-XX:+UseG1GC'
,已成功将其添加到standalone.conf中,如下所示:
#
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms2048m -Xmx2048m -XX:MaxPermSize=128m"
- JAVA_OPTS="$JAVA_OPTS "
+ JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
当我进一步添加
wildfly::java_opts: '-Xloggc:/opt/jboss-eap/gc_logs/jvm-gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps'
第一个被删除:JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC"
被删除。输出如下:
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms2048m -Xmx2048m -XX:MaxPermSize=128m"
- JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC"
+ JAVA_OPTS="$JAVA_OPTS -Xloggc:/opt/jboss-eap/gc_logs/jvm-gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS".