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

Technote (FAQ)


Question

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

Cause

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.


Answer

** 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 and 6.1
WebSphere Application Server 6.0 and 5.1


WebSphere Application Server 8.5, 8.0, 7.0 and 6.1

-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.





WebSphere Application Server 6.0 and 5.1

-Xverbosegclog: <path to file><filename>
Causes verboseGC output to be written to the specified file. If the file cannot be found, verboseGC 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. Use .%p to append the process id to the file name.

-Xverbosegclog:<path to file><filename, X, Y>
    1. Filename must contain a "#" (hash symbol), which is substituted with a generation identifier, starting at X and Y are integers. This option works similarly to -Xverbosegclog:<path to file><filename>, but, in addition, the verboseGC output is redirected to X files, each containing verboseGC output from Y GC cycles.

      **Example: -Xverbosegclog:/opt/WebSphere/logs/gc#.log,100,1000
      The above setting would create 100 log files named gc<incremental_number>.log with 1000 GC cycles each.
    1. In the administrative console, click Servers > Application Servers >server. 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 1.4.2 Garbage Collector command-line parameters
Java 5.0 Garbage Collector command-line options
Java 6 Garbage Collector command-line options
Enabling verbose garbage collection (verbosegc) in WebS
Java 7 Garbage Collector Command Line Options

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Application Server
Java SDK

Software version:

5.1, 6.0, 6.1, 7.0, 8.0, 8.5

Operating system(s):

AIX, Linux, Windows

Reference #:

1384096

Modified date:

2009-05-22

Translate my page

Machine Translation

Content navigation