My Oracle Support Banner

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

Last updated on AUGUST 18, 2023

Applies to:

Oracle WebLogic Server - Version 10.3.6 to 14.1.1.0.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>)

 

This document isn't applied to JDK 9 or later. So it does not apply to Oracle WebLogic Server 14.1.1 on JDK11.
Oracle WebLogic Server 14.1.1 will not be started if the GC log options on this document are set for JDK 9 or later.
Please see "Mapping Legacy Garbage Collection Logging Flags to the Xlog Configuration" for JDK11 and later.

 

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.