How to do force full garbage collection when heap usage goes beyond a certain threshold
mohd shaban
mohdshaban000123 at gmail.com
Mon Feb 24 19:45:35 UTC 2020
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>
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>
> 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
>> > 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/20200225/7cf6b2ab/attachment.htm>
More information about the hotspot-gc-use
mailing list