Loading
Slack製品の問い合わせ先はSalesforce Helpへ統合・変更されます続きを読む

On-Premises Mule Garbage Collection Logs

公開日: Nov 9, 2026
前提条件
This article covers on-premises and hybrid standalone Mule Runtime. It does not cover CloudHub. Option 1 requires a Java Development Kit (JDK), not only a Java Runtime Environment (JRE). Option 2 edits $MULE_HOME/conf/wrapper.conf. Replace each n with a unique unused sequence number. Do not edit wrapper-additional.conf. Restart Mule after you change wrapper.conf.
タスク

Collect garbage collection (GC) logs for an on-premises Mule Runtime instance.

ステップ

Collect garbage collection (GC) logs on an on-premises Mule Runtime so you can diagnose heap and pause-time issues. CloudHub workers do not expose wrapper.conf. This article does not apply to CloudHub.

The JVM flags you add in Option 2 depend on the JDK major version, not on ParallelGC versus G1GC. Mule 4.6 long-term support (LTS) still runs Java 8, 11, and 17. Mule 4.9 and later run Java 17 only. See Java Support | MuleSoft Documentation.

1. Collect GC statistics with jstat (no restart)

Install a JDK, not only a JRE. jstat is a JDK tool. Oracle documents it as experimental and unsupported. Replace <pid> with the operating-system process ID of the Mule JVM, then run:

jstat -gccause -h 1000 -t <pid> 10s > gc.log

The command writes samples to gc.log every 10 seconds and prints a column header every 1000 samples. You do not restart Mule. The Timestamp column is elapsed time in seconds since the target JVM started, not milliseconds. Young-generation GC count (YGC), full GC count (FGC), and the GC time columns are cumulative. See The jstat Command.

2. Enable GC file logs in wrapper.conf (restart required)

When only a JRE is installed, or you need a rotating GC log file from JVM start, add unused wrapper.java.additional.<n> lines in $MULE_HOME/conf/wrapper.conf. Each <n> must be unique. If two lines share the same number, the Java Service Wrapper keeps one and ignores the other. Do not edit wrapper-additional.conf; Mule regenerates that file. After you change wrapper.conf, stop and start Mule so the new flags apply. See Download, Install, Configure, and Upgrade On-Premises Mule Runtime Engine | MuleSoft Documentation.

Java 8

On Java 8, add these flags. Uncomment them if they are already present and commented out. Replace each <n> with a unique unused sequence number:

wrapper.java.additional.<n>=-XX:+PrintGCApplicationStoppedTime
wrapper.java.additional.<n>=-XX:+PrintGCDetails
wrapper.java.additional.<n>=-XX:+PrintGCDateStamps
wrapper.java.additional.<n>=-Xloggc:%MULE_HOME%/logs/gc.log
wrapper.java.additional.<n>=-XX:+UseGCLogFileRotation
wrapper.java.additional.<n>=-XX:NumberOfGCLogFiles=5
wrapper.java.additional.<n>=-XX:GCLogFileSize=10M

To keep a new file across restarts, include the process ID (%p) and a timestamp (%t) in the -Xloggc file name:

wrapper.java.additional.<n>=-Xloggc:%MULE_HOME%/logs/gc-%p-%t.log

Java 11 and Java 17

On Java 11 and Java 17, the Java 8 PrintGC flags are removed. The JVM exits with Unrecognized VM option for PrintGCApplicationStoppedTime, PrintGCDetails, and -Xloggc. That failure is the JDK version, not G1GC versus ParallelGC. See Mule 4 Application on Java 11 or Java 17 Fails to Start Due to Certain Deprecated GC Logging Flags Enabled.

Use unified logging instead. Oracle maps -XX:+PrintGCDetails to -Xlog:gc* and -Xloggc:filename to -Xlog:gc:filename. Add one unused sequence number:

wrapper.java.additional.<n>=-Xlog:gc*:file=%MULE_HOME%/logs/gc.log:tags,time,uptime,level:filecount=10,filesize=2M

After you have the logs, see How to analyze GC logs effectively.

 

ナレッジ記事番号

001115026

 
読み込み中
Salesforce Help | Article