IBM Support

Writing Verbose GC to a Specified Log -Xverbosegclog in AIX, Linux and Windows

Question & Answer


How do you get verbose GC output to another log besides native_stderr?


Verbose GC data is captured by default in the native_stderr.log for AIX®, Windows® and Linux® and native_stdout.log for Solaris and HP.

Note: For writing verbose gc to a specified log in Solaris and HP-UX, please see this link.

At present there is no capability to rotate native_stderr logs in WebSphere. Therefore you can use -Xverbosegclog to minimize the size/contents of the native_stderr log file.


** Note: When using Verbose GC to analyze JVM problems, it is best to leave the verbose GC logging to the default location. When writing Verbose GC to a specified log, occasional error messages are omitted or not set in-line with the data. This can make diagnosing the problem very difficult and prolong time to resolution.**

WebSphere Application Server 8.5, 8.0, 7.0

Causes -verbose:gc output to be written to the specified file. If the file cannot be found, -verbose:gc tries to create the file, and then continues as normal if it is successful. If it cannot create the file (for example, if an invalid filename is passed into the command), it will redirect the output to stderr.

If you specify <X> and <Y> the -verbose:gc output is redirected to <X> files, each containing <Y> GC cycles.

The dump agent tokens can be used in the filename. See Dump agent tokens for more information. If you do not specify <file>, verbosegc.%Y%m%d.%H%M%S.%pid.txt is used.

example: -Xverbosegclog:newgclogname.log,7,10000

  1. In the administrative console, click Servers > Server Types > WebSphere application servers > server_name. Then, under Server Infrastructure, click Java™ and process management > Process definition.
  2. Select Java Virtual Machine .
  3. Specify values for the JVM settings as needed and click OK.
  4. Click Save on the console task bar.
  5. Restart the application server.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU004","label":"Hybrid Cloud"},"Component":"Java SDK","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.5;8.0;7.0","Edition":""}]

Document Information

Modified date:
15 June 2018