WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  GC Policy -Xnoclassgc

    Posted Mon November 12, 2018 06:59 AM
    Hi

    We are using WAS 8.5.5.7 and JAVA 7.0.4.1

    Verbose garbage collection has been enabled.
    The following Generic JVM arguments which relates to GC has been added as per application vendor recommendation.
    -XX:+UseParallelOldGC -XX:+UseAdaptiveSizePolicy -Xnoclassgc -Djava.nio.channels.spe.SelectorProvider=sun.nio.ch.DevPollSelectorProvider -XX:+UseSpinning -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCTimeStamps -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCDateStamps -XX:NewSize=1024m -XX:MaxNewSize=2048m

    1. As Verbose garbage collection is enabled, I expect logging on stderr log, but this is not happening.  Can this be caused by additional generic arguments gc arguments? If yes.. which argument? Xnoclassgc
    2. I have read Xnoclassgc is not recommended as it can cause OOM issues.  When is it advisable to use it?

    Regards,
    Sandile

    ------------------------------
    Mziwandile Sithebe
    IBM
    ------------------------------


  • 2.  RE: GC Policy -Xnoclassgc

    Posted Mon November 12, 2018 01:40 PM
    Hi

    Just discovered that WAS is running on Solaries, therefore the gc info in written on stdout.log not stderr.log.

    Now my question is what is the effect of -XX:+DisableExplicitGC generic argument?
    Does this completely disable any garbage collection?

    Regards

    ------------------------------
    Mziwandile Sithebe
    IBM
    ------------------------------



  • 3.  RE: GC Policy -Xnoclassgc

    Posted Tue November 13, 2018 01:29 AM
    Hello,
    -XX:+DisableExplicitGC does not completely disabled garbage collection (otherwise you JVM would quickly run OOM) but this option turns the System.gc() calls from the application to a no-op. So if you application does not use System.gc() calls it should not make a difference here.
    Also be careful setting this option as the direct memory buffer code calls System.gc() as well before extending the buffers (unless you have -XX:MaxDirectMemorySize=<size> set).

    Hope this helps ...

    ------------------------------
    Hermann Huebler
    ------------------------------



  • 4.  RE: GC Policy -Xnoclassgc

    Posted Tue November 13, 2018 03:49 AM
    "What is the effect of -XX:+DisableExplicitGC generic argument? Does this completely disable any garbage collection?"

    No. Developers can request an immediate garbage collection in Java code by calling System.gc(). This argument effectively disables that method on the System class and only runs garbage collection according to the algorithm and other options selected in the JVM arguments. Generally speaking, it is better to leave the timing of garbage collection to the JVM and not try to invoke it explicitly, so including this argument is really just imposing the best practice on developers.


    ------------------------------
    Neil Weightman
    ------------------------------



  • 5.  RE: GC Policy -Xnoclassgc

    Posted Wed November 14, 2018 02:02 AM
    Thank you Hermann and Neil, really appreciated.

    One last question... what is the effect of -Xnoclassgc?

    Regards,
    Sandile


  • 6.  RE: GC Policy -Xnoclassgc

    Posted Thu November 15, 2018 04:37 AM
    When the JVM loads a new class, it has to store the class object and information about the class in the JVM heap in a region called the "permanent generation" or "PermGen", which is relatively small - a few 10s of MB typically. This region is normally part of the regular GC process and will be tidied up, removing information on classes which are no longer required. If you use the -Xnoclassgc JVM command line option, this tidying up is disabled, so eventually space will run out and you'll get an OOM error. I don't know why you'd want that; IBM recommends that you only use the option when directed to by IBM Support.

    I hope that helps.


    ------------------------------
    Neil Weightman
    ------------------------------