IBM Support

Enabling verbose garbage collection (verboseGC) in WebSphere Application Server

Troubleshooting


Problem

Enabling verboseGC output is often required when diagnosing issues with WebSphere Application Server. Because verboseGC data is critical to troubleshooting memory and performance problems and the overhead is generally very low, you may want to consider proactively enabling it in your environment. The following describes how to enable verboseGC output within WebSphere Application Server.

Resolving The Problem


Select the appropriate version and server type:
Version 9, 8.5, 8.0 and 7.0 - Application Servers
Version 9, 8.5, 8.0, 7.0- Deployment Managers
Version 9, 8.5, 8.0, 7.0- Node Agents
Version 9, 8.5, 8.0, 7.0- Enabling at Runtime


Depending on the operating system in use, the verboseGC output will be written to the following file by default:
AIX, Linux, or Windows: native_stderr.log
Solaris or HP-UX native_stdout.log


Enabling verboseGC on releases of Version 9, 8.5, 8.0 and 7.0 - Application Servers




  1. In the Administrative Console, expand Servers, expand Server Types, and then click WebSphere application servers.
  2. Click on the server that you would like to work with, for example, server1.
  3. On the Configuration tab, under Server Infrastructure, expand Java and Process Management, and click Process Definition.

  4. Under the Additional Properties section, click Java Virtual Machine.

  5. Check the Verbose Garbage Collection check box.

    For Solaris or HP-UX, also complete these additional steps.

  6. Apply and Save the changes.

  7. Restart the Application Server for the changes to take effect.





Enabling verboseGC on releases of Version 9, 8.5, 8.0, 7.0 - Deployment Managers
  1. In the Administrative Console, expand System Administration and then click Deployment Manager.

  2. On the Configuration tab, under Server Infrastructure, expand Java and Process Management, and click Process Definition.

  3. Under the Additional Properties section, click Java Virtual Machine.

  4. Check the Verbose Garbage Collection check box.

    For Solaris or HP-UX, also complete these additional steps.

  5. Apply and Save the changes.

  6. Restart the Deployment Manager for the changes to take effect.


Enabling verboseGC on releases of Version 9, 8.5, 8.0, 7.0 - Node Agents
  1. In the Administrative Console, expand System Administration and then click Node Agents.

  2. Click on the node agent that you would like to work with.

  3. On the Configuration tab, under Server Infrastructure, expand Java and Process Management, and click Process Definition.

  4. Under the Additional Properties section, click Java Virtual Machine.

  5. Check the Verbose Garbage Collection check box.

    For Solaris or HP-UX, also complete these additional steps.

  6. Apply and Save the changes.

  7. Restart the Node Agent for the changes to take effect.


Additional Steps for Solaris and HP-UX
Add the following parameters to the Generic JVM arguments:



For WebSphere Application Server 7.0 (Java 6) and later:

-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintHeapAtGC


Enabling verboseGC at Runtime - Version 9, 8.5, 8.0, 7.0
Before enabling verboseGC at runtime you should follow the appropriate instructions above to enable verboseGC within your configuration. This will ensure that when the JVM is restarted verboseGC will be enabled.

  1. Using the appropriate instructions above, navigate to the Java Virtual Machine page.

  2. Click the Runtime tab. This tab will be present if the JVM is running.

  3. Check the Verbose Garbage Collection check box.

  4. Click OK.

Note: Verbosegc can be enabled at runtime in Version 9, 8.5, 8.0, 7.0 on all operating systems; however, it will only produce meaningful output on AIX, Linux, and Windows. This is due to the fact that both Solaris and HP-UX require additional Generic JVM arguments to produce meaningful output. These additional arguments cannot be added at runtime.

 

Internal Use Only




Version 9, 8.5, 8.0 and 7.0 - Application Servers
Version 6.1 and 6.0 - Application Servers
Version 8.5, 8.0, 7.0, 6.1, and 6.0 - Deployment Managers
Version 8.5, 8.0, 7.0, 6.1, and 6.0 - Node Agents
Version 8.5, 8.0, 7.0, and 6.1 - Enabling at Runtime

Diagnosing memory leaks with Java on HP-UX link: http://www.hp.com/products1/unix/java/infolibrary/prog_guide/diag_memory_leaks.html






Enabling verbosegc on releases of Version 5.1 - Application Servers
  1. In the Administrative Console, expand Servers and then click Application Servers.

  2. Click on the server that you would like to work with, for example, server1.

  3. Under the Additional Properties section, click Process Definition.

  4. Under the Additional Properties section, click Java Virtual Machine.

  5. Check the Verbose Garbage Collection check box.

    For Solaris or HP-UX, also complete these additional steps.

  6. Apply and Save the changes.

  7. Restart the Application Server for the changes to take effect.



Enabling verbosegc on releases of Version 5.1 - Deployment Managers
  1. In the Administrative Console, expand System Administration and then click Deployment Manager.

  2. Click Process Definitions under Additional Properties.

  3. Click Java Virtual Machine.

  4. Check the Verbose Garbage Collection check box.

    For Solaris or HP-UX, also complete these additional steps.

  5. Apply and Save the changes.

  6. Restart the Deployment Manager for the changes to take effect.






Enabling verbosegc on releases of Version 5.1 - Node Agents
  1. In the Administrative Console, expand System Administration and then click Node Agents.

  2. Click on the node agent that you would like to work with.

  3. Click Process Definitions under Additional Properties.

  4. Click Java Virtual Machine.

  5. Check the Verbose Garbage Collection check box.

    For Solaris or HP-UX, also complete these additional steps.

  6. Apply and Save the changes.

  7. Restart the Node Agent for the changes to take effect.










Version 4.0 Advanced Edition
Version 4.0 Advanced Single Server Edition
Version 3.5





Enabling verbosegc on releases of Version 4.0 Advanced Edition
  1. In the Administrative Client, select the Application Server and go to the JVM Settings tab.

  2. Click Advanced JVM Settings.

  3. Select the check box Enable garbage collection verbose mode.

  4. Click OK.

  5. Click Apply.

  6. Stop and restart the Application Server.

  7. The verbose garbage collection output will be placed in the stderr file for the Application Server.

Note:
  • For an HP-UX system, add the following parameter to the command line arguments field located on the Advanced JVM Settings panel:

  • -Xverbosegc:file=<name>

    Where <name> is a valid fully qualified filename.







Enabling verbosegc on releases of Version 4.0 Advanced Single Server Edition
  1. Edit the server-cfg.xml file found in the directory, install_root/config.

  2. Search on command and find, commandLineArgument="".

  3. In the empty quotes, add -verbosegc so that it looks like the following:

  4. commandLineArgument="-verbosegc"

  5. Stop and restart the application server.

Note:
  • For an HP-UX system, also add to the following parameter to the commandLineArgument:

  • -Xverbosegc:file=<name>

    Where <name> is a valid fully qualified filename.






Enabling verbosegc on releases of Version 3.5
  1. In the Administrative Client, select the Application Server and go to the General tab.

  2. Add the following line to the Command line arguments field:

  3. -verbosegc

  4. Click Apply.

  5. Stop and restart the Application Server.

  6. The verbose garbage collection output will be placed in the stderr file for the Application Server.

Note:
  • If using Solaris, enter the argument twice as follows:

  • -verbosegc -verbosegc








Notes:
  • For an HP-UX system, add the following parameter to the Generic JVM arguments on the Java Virtual Machine Settings page:

  • -Xverbosegc:file=<name>

    Where <name> is a valid fully qualified filename.

  • For a Solaris system, add the following parameters to the Generic JVM arguments on the Java Virtual Machine Settings page:

  • -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC

    The -XX:+PrintHeapAtGC parameter will generate a large amount of logging to the native_stdout.log file. Ensure there is adequate file system space when enabling this option.


[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU004","label":"Hybrid Cloud"},"Component":"Java SDK","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.5;8.0;7.0","Edition":"Base;Express;Network Deployment"},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU004","label":"Hybrid Cloud"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":""},{"Product":{"code":"SS7JFU","label":"WebSphere Application Server - Express"},"Business Unit":{"code":"BU004","label":"Hybrid Cloud"},"Component":"J2EE Development and deployment","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.0;6.1;6.0.2;6.0.1;6.0;5.1.1;5.1","Edition":""}]

Document Information

Modified date:
15 June 2018

UID

swg21114927