My Oracle Support Banner

Questions Specific to System.gc() or Runtime.getRuntime.gc() Calls (Doc ID 2549527.1)

Last updated on NOVEMBER 14, 2020

Applies to:

Java SE JDK and JRE - Version 8 to 8
Information in this document applies to any platform.


  1. If either System.gc() or Runtime.getRuntime.gc() calls are made, do they "force" a Garbage Collection (GC) or just provide a hint to perform a GC?
  2. Can the effects of full garbage collections be mitigated by using options such as -XX:+ExplicitGCInvokesConcurrent?
  3. What can be searched for in the Garbage First Garbage Collector (G1GC or just G1) logs, to determine when a GC was performed as a result of code calling System.gc() or Runtime.getRuntime.gc()?
  4. If a third party library is suspected of calling System.gc() or Runtime.getRuntime.gc() methods explicitly, what techniques can be used to find out which library is making these calls?


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

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