IBM Support

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

Technote (FAQ)


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

-Xverbosegclog[: <file> [,<X>,<Y>]]
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.

Related information

Java 6 Garbage Collector command-line options
Enabling verbose garbage collection (verbosegc)
Java 7 Garbage Collector Command Line Options

Document information

More support for: WebSphere Application Server
Java SDK

Translate this page: