Hi,

On 24.02.20 08:45, mohd shaban wrote:
Hi Team,

Is there a way to force GC when heap usage goes beyond a certain threshold?.
I am using G1GC Algorithm.

Thanks,
Mohd Shaban


G1 fully supports the MemoryMXBean API [0] to monitor memory usage either via polling or notifications.

You can issue a System.gc() in response to this information. It forces some kind of GC.

Hth,
  Thomas

[0] https://docs.oracle.com/javase/10/docs/api/java/lang/management/MemoryMXBean.html
_______________________________________________
hotspot-gc-use mailing list
hotspot-gc-use@openjdk.java.net
https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use

Reply via email to