WebSphere Application Server & Liberty

 View Only
  • 1.  Enable GC logs in WAS V9

    Posted Thu March 22, 2018 09:28 AM

    Hi All,

     

    I have been migrating WebSphere V8 to WebSphere V9.

    Anyone knows how we can enable GC logs in WAS 9? I have already checked "Verbose garbage collection" in server configuration, but no success.

    We are using: RedHat Linux OS

    The output must be like this.

     

    66223.402: [GC [PSYoungGen: 102429K->21498K(105856K)] 423582K->343429K(499072K), 0.0200402 secs] [Times: user=0.11 sys=0.01, real=0.02 secs]
    267768.481: [GC [PSYoungGen: 101946K->21910K(105664K)] 423877K->344595K(498880K), 0.0194215 secs] [Times: user=0.10 sys=0.00, real=0.02 secs]
    269323.538: [GC [PSYoungGen: 102355K->22089K(105856K)] 425039K->345551K(499072K), 0.0200960 secs] [Times: user=0.11 sys=0.01, real=0.02 secs]
    270861.340: [GC [PSYoungGen: 102729K->21908K(105856K)] 426191K->346148K(499072K), 0.0236492 secs] [Times: user=0.11 sys=0.01, real=0.02 secs]
    272404.130: [GC [PSYoungGen: 102548K->22006K(106048K)] 426788K->347098K(499264K), 0.0199844 secs] [Times: user=0.11 sys=0.00, real=0.02 secs]
    273943.705: [GC [PSYoungGen: 102966K->21794K(105984K)] 428058K->347680K(499200K), 0.0195593 secs] [Times: user=0.10 sys=0.00, real=0.02 secs]
    275050.360: [GC [PSYoungGen: 102754K->16647K(105344K)] 428640K->343294K(498560K), 0.0155326 secs] [Times: user=0.09 sys=0.01, real=0.02 secs]



  • 2.  RE: Enable GC logs in WAS V9

    Posted Thu March 22, 2018 09:34 AM

    I assume you are using traditional WAS. You did the first step namely checking the "Verbose garbage collection" attribute. In this case the GC output goes to the default location namely native_stderr.log.

    However you can redirect this to a file of your choice by using the  generic JVM setting: -Xverbosegclog. This allows to specify the output directory as well as log rotation policy.

    For example:

    -Xverbosegclog:${SERVER_LOG_ROOT}/verbosegc.%Y%m%d.%H%M%S.%pid.txt,20,10000



  • 3.  RE: Enable GC logs in WAS V9

    Posted Thu March 22, 2018 09:50 AM

    Hermann,

     

    I have tried to generate the specific file for GC logs but I am getting in XML format.















     

    Is there any way to have the output like below?

    272404.130: [GC [PSYoungGen: 102548K->22006K(106048K)] 426788K->347098K(499264K), 0.0199844 secs] [Times: user=0.11 sys=0.00, real=0.02 secs]
    273943.705: [GC [PSYoungGen: 102966K->21794K(105984K)] 428058K->347680K(499200K), 0.0195593 secs] [Times: user=0.10 sys=0.00, real=0.02 secs]
    275050.360: [GC [PSYoungGen: 102754K->16647K(105344K)] 428640K->343294K(498560K), 0.0155326 secs] [Times: user=0.09 sys=0.01, real=0.02 secs]

     

    Thanks,



  • 4.  RE: Enable GC logs in WAS V9

    Posted Thu March 22, 2018 09:53 AM

    WAS on RHEL is using the IBM JVM and the GC log of the IBM JVM is in XML format (btw - was the same on WAS8). The log format you want is from Oracle's JVM and the IBM JVM can't create GC logs like that agaik.

     

    But all tools for the IVM JVM (like GCMV) understand that format.



  • 5.  RE: Enable GC logs in WAS V9

    Posted Fri March 23, 2018 03:22 AM

    As Hermann said, traditional WAS verbosegc log format _is_ XML.

    If you are using Liberty, you can switch over to OpenJDK or Oracle JDK , where the verbosegc output looks like what you pasted in your original post.

     

    regards,  Thomas