[jboss-jira] [JBoss JIRA] (WFCORE-3996) GC logging is not working on Java 9

James Perkins (JIRA) issues at jboss.org
Tue Aug 14 14:20:01 EDT 2018


    [ https://issues.jboss.org/browse/WFCORE-3996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13619090#comment-13619090 ] 

James Perkins commented on WFCORE-3996:
---------------------------------------

I think this is what we want for the {{JAVA_OPTS}} on Java 9+
{code}
-Xlog:gc*:file=$JBOSS_LOG_DIR/gc.log:time,uptimemillis:filecount=5,filesize=3M
{code}

We need to remove the {{-verbose:gc}} which will stop the stderr output. We could also do something like:
{code}
-Xlog:gc*=$GC_LOG_LEVEL:file=$JBOSS_LOG_DIR/gc.log:time,uptimemillis:filecount=5,filesize=3M
{code}

which would default {{GC_LOG_LEVEL}} to {{info}} so if we need {{debug}} or {{trace}} it could be overridden without requiring a script change.

Also because this was part of a JEP all JVM vendors must support the flags so we shouldn't need to test if the options exist, e.g. {{"$JAVA" $JVM_OPTVERSION -Xlog:gc*:file="$JBOSS_LOG_DIR/gc.log":time,uptimemillis:filecount=5,filesize=3M -version >/dev/null 2>&1 &&}} can go away for Java 9+.

> GC logging is not working on Java 9
> -----------------------------------
>
>                 Key: WFCORE-3996
>                 URL: https://issues.jboss.org/browse/WFCORE-3996
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: Scripts
>            Reporter: Rostislav Svoboda
>            Assignee: Radovan Stancel
>            Priority: Blocker
>              Labels: Java11, blocker-WF14
>
> GC logging is not working on Java 9. This is related to the fact G1 GC is default and there are changes in configuration option.
> {code}
> GC_LOG="true" ./standalone.sh
> {code}
> Java 8:
> {code}
> JAVA_OPTS:  -server -verbose:gc -Xloggc:"/Users/rsvoboda/TESTING/7.2.0.CD12.CR1/jboss-eap-7.2/standalone/log/gc.log"
>  -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5
>  -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M 
>  -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
> {code}
> Java 9:
> {code}
> JAVA_OPTS:  -server -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m
>  -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
> {code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list