2013년 9월 3일 화요일

[TechNote] Writing Verbose GC to a Specified Log -Xverbosegclog



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.

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

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






-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

댓글 없음:

댓글 쓰기