My Oracle Support Banner

How To Set GC Log on WebLogic (Doc ID 2727874.1)

Last updated on NOVEMBER 12, 2020

Applies to:

Oracle WebLogic Server - Version 10.3.6 to 12.2.1.4.0
Information in this document applies to any platform.

Goal

GC Log is an important log to observe memory utilization, GC time, and frequency of the Java process.

This log is a must for investigating OutOfMemoryError, hang, and performance issues.

This document applies the below versions.
- JDK 7u76 and later
- JDK 8

This document describes GC log options of JDK only.
Please see the following document on how to set the java options to WebLogic.
Best Practices to Configure JAVA_OPTIONS for Oracle Fusion Middleware / Oracle WebLogic Server (<Document 2160246.1>)

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
 1. Typical GC log options which are needed to investigate memory issues at least
 2. Typical GC log options with log rotation options.
 3. Finest GC log options (-XX:+PrintHeapAtGC is added) with rotation

 Example:
 Option details:
 -Xloggc:<DIR>/<GCLog_File_Name>
 -XX:+PrintGCDateStamps
 -XX:+PrintGCDetails
 GC Log rotation configurations:
 -XX:+UseGCLogFileRotation
 -XX:NumberOfGCLogFiles=<NUMBER_OF_FILES>
 -XX:GCLogFileSize=<FILE_SIZE>
 Example:
 -XX:+PrintHeapAtGC
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.