Exceeding the upper limit

I need my Oracle access point to throw an exception java.lang.OutOfMemoryError: GC overhead limit exceededmuch earlier than with the default options UseGCOverheadLimit.

By default, OOME occurs when more than 98% of the time is spent in the GC and less than 2% of the heap is restored (described http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par_gc.oom )

For example, I need my JVM to throw OOME when more than 20% of the time is spent on the GC. Unfortunately, -XX:GCTimeRatio=nnit doesn't seem to matter.

The reason I need to configure the JVM in this way is because I am testing my application whether it has a memory leak (for sure, I have a memory leak detection infrastructure where I want to test our application daily) and I don’t need mine JVM to try to free the heap as quickly as possible.

+4
source share
1 answer

By default, OOME occurs when more than 98% of the time is spent on the GC and less than 2% of the heap is recovered.

These two values ​​are configured with GCHeapFreeLimitandGCTimeLimit

GCTimeRatio defines only a soft target for which the GC heuristic is optimized.

+2
source

Source: https://habr.com/ru/post/1605917/


All Articles