How to do force full garbage collection when heap usage goes beyond a certain threshold
Bernd Eckenfels
ecki at zusammenkunft.net
Mon Feb 24 21:03:28 UTC 2020
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-bounces at openjdk.java.net> im Auftrag von mohd shaban <mohdshaban000123 at gmail.com>
Gesendet: Monday, February 24, 2020 8:45:35 PM
An: Leo Korinth <leo.korinth at oracle.com>; hotspot-gc-use at openjdk.java.net <hotspot-gc-use at 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 <mohdshaban000123 at gmail.com<mailto:mohdshaban000123 at 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.korinth at oracle.com<mailto:leo.korinth at 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 at openjdk.java.net<mailto:hotspot-gc-use at openjdk.java.net>
> https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20200224/6cc59b9b/attachment-0001.htm>
More information about the hotspot-gc-use
mailing list