‑Xenableexcessivegc / ‑Xdisableexcessivegc
Enables or disables 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.
OutOfMemory exception is thrown only when the heap has been fully expanded and the percentage of application run time that is not 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