‑Xenableexcessivegc / ‑Xdisableexcessivegc
These options enable or disable the throwing of an OutOfMemory
exception if excessive time is spent in the GC.
If excessive time is spent in the GC, the option returns null
for an allocate request and thus causes an OutOfMemory
exception to be thrown.
Note: The OutOfMemory
exception is thrown only when the heap has been fully expanded and the percentage of application run time that is spent in garbage collection is at least 95%. This percentage is the default value that triggers an excessive GC event. You can control this value with the -Xgc:excessiveGCratio
option.
Syntax
Setting | Effect | Default |
---|---|---|
-Xenableexcessivegc |
Enable exception | yes |
-Xdisableexcessivegc |
Disable exception |
These options can be used with all Eclipse OpenJ9™ GC policies.