Hello Mohd,

Would be good if you can upload sample GC logs which show the issue. If a mixed 
collection does not clean up your heap but a FullGC does you might need to look 
into soft references or direct buffers.

If you have generally smallish heap one option would be to go to ParallelOld 
GC, it is less sensitive to fragmentation.

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Von: hotspot-gc-use <hotspot-gc-use-boun...@openjdk.java.net> im Auftrag von 
mohd shaban <mohdshaban000...@gmail.com>
Gesendet: Monday, February 24, 2020 8:45:35 PM
An: Leo Korinth <leo.kori...@oracle.com>; hotspot-gc-use@openjdk.java.net 
<hotspot-gc-use@openjdk.java.net>
Betreff: Re: How to do force full garbage collection when heap usage goes 
beyond a certain threshold

Hi Leo ,

Actually we set up alerts for heap utilisation and we are getting to many 
alerts.
So we have done the analysis and found more heap utilisation and once GC 
happened it backs to normal but suppose my alert scheduler runs at 8:00 and at 
the same heap usage reach to 90 then we get the alert, But when i monitor the 
heap usage , after 8:02 GC happened and it back to normal usage means 50%.

So that why we want if heap usage reaches to 80-85% we trigger the GC so that 
we can't get the alerts.

Please suggest how can we achieve this?

Thanks,
Mohd Shaban

On Mon, Feb 24, 2020 at 11:09 PM mohd shaban 
<mohdshaban000...@gmail.com<mailto:mohdshaban000...@gmail.com>> wrote:
Hi Leo ,

Actually we set up alerts for heap utilisation and we are getting to many 
alerts.
So we have done the analysis and found more heap utilisation and once GC 
happened it backs to normal but suppose my alert scheduler runs at 8:00 and at 
the same heap usage reach to 90 then we get the alert, But when i monitor the 
heap usage , after 8:02 GC happened and it back to normal usage means 50%.

So that why we want if heap usage reaches to 80-85% we trigger the GC so that 
we can't get the alerts.

Please suggest how can we achieve this?

Thanks,
Mohd Shaban

On Mon, Feb 24, 2020 at 7:13 PM Leo Korinth 
<leo.kori...@oracle.com<mailto:leo.kori...@oracle.com>> wrote:
Hi Mohd,

You probably do not want to force a a full gc with g1. G1 is designed so
that you should be abled to do young/mixed collections and never have to
do a full one.

Your probably ought to be on running a full gc as few times as possible.
Forcing premature full collections will probably add latency, reduce
throughput and mess with valuable statistics for meeting deadlines.
Also, before Java 10, full gc for g1 was single threaded.

If you still have a good use case for it after this warning, you might
want to weaken the explicit gc by making it a concurrent one
(-XX:+ExplicitGCInvokesConcurrent).

What underlying problem is it you are trying to solve? Maybe it can be
solved by other means?

Thanks,
Leo


On 24/02/2020 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
>
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use@openjdk.java.net<mailto:hotspot-gc-use@openjdk.java.net>
> https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>
_______________________________________________
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