Hello,
Basicly System.gc will no longer be able compact your memory or free up
as much as possible. You or a customer or a thirdparty may have a
usecase where thats desirable and now they can no longer do this.
https://ionutbalosin.com/2020/01/hotspot-jvm-performance-tuning-guidelines/
Also mentions something about native buffers, I dont know how accurate
this is, how it works with concurrent, and how relevant it is for your
application.
Just like Thomas I would recommend to use another garbage collector
(Your usecase is basicly the reason they exist) and or analyze your
problem correctly (collect gc logs) ||//Basicly try to solve the problem
and and not to just hide the symptoms.
I am not an expert in that matter but setting |-XX:-G1UseAdaptiveIHOP|
and |-XX:InitiatingHeapOccupancyPercent| to something very low like 15
might be a better alternative to call System.gc in a loop.||
Best regards,
Thorsten
//
Am 29/06/2021 um 14:04 schrieb Stefan Reich:
Hi Thorsten,
yes I used to call System.gc() once a minute. I just like to see
correct heap usages. However, for the server, I removed the call
because I didn't like the delays (they are around or slightly above 2
seconds BTW - actually measured this tiime :).
I have just tried XX:+ExplicitGCInvokesConcurrent. I think it's good;
seems to do the job. So my problem may actually be solved. I'll keep
monitoring.
> Setting /ExplicitGCInvokesConcurrent /may or may not have some
unintended side effects.
Please elaborate, what could those be? I am not aware of any side
effects. I need concrete information.
Best wishes,
Stefan
On Tue, 29 Jun 2021 at 09:16, Thorsten <t...@freigmbh.de
<mailto:t...@freigmbh.de>> wrote:
Hello,
So If I understand you correctly you explicitly invoke System.gc()
and get long pauses for that call. Simple Solution: remove the
call to System.gc() and tune from there. Worse (possible)
solution: try setting -XX:+/ExplicitGCInvokesConcurrent/
Setting /ExplicitGCInvokesConcurrent /may or may not have some
unintended side effects. I strongly recommend to remove all calls
to System.gc that are not for debugging/maintenance.
Best Regards,
Thorsten
//
Am 28/06/2021 um 19:39 schrieb Stefan Reich:
Hi Thorsten!
Does MaxGCPauseMillis apply to System.gc() too? I thought this
was for the incremental collections.
> Did you parse gc logs or by hand/feel?
What, do you think I'm a beginner??? :D
Joke aside, yes it was just "by feel". I know I should measure it
properly. Is timing the call to System.gc() an acceptable way to
measure this? As far as I know, it only returns after GC has
actually completed.
> If you are certain that you don't need more than 800mb of live
objects, limit the maxheap to something like 1.5 gb.
Hmm, I am rather not that certain about that... I'd like to keep
the max heap around 6 GB.
On Mon, 28 Jun 2021 at 09:35, Thorsten <t...@freigmbh.de
<mailto:t...@freigmbh.de>> wrote:
Hello,
You should not get seconds long stop the world event. How did
you measure the pauses? Did you parse gc logs or by hand/feel?
The desired max pause for g1 can be tuned using
|-XX:MaxGCPauseMillis=200|
|, so 200 ms max pause should be the default.
|
It would be helpfull if you take gc logs and provide them.
What java version are you using? In old java versions g1 is
fairly bad, quality improves in newer versions.
You can tune and change the garbage collector using -XX
Options, see for example here
https://ionutbalosin.com/2020/01/hotspot-jvm-performance-tuning-guidelines/
<https://ionutbalosin.com/2020/01/hotspot-jvm-performance-tuning-guidelines/>
Maybe you find one of the experimental garbage collectors
helpfull for your application.
Another simple "Hack" to tune your gc speed: If you are
certain that you don't need more than 800mb of live objects,
limit the maxheap to something like 1.5 gb. That way your app
is simply unable to collect gigabytes of garbage and your max
pauses will go down.
Best regards,
Thorsten
_______________________________________________
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
<https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use>
--
Stefan Reich
BotCompany.de // Java-based operating systems
--
Stefan Reich
BotCompany.de // Java-based operating systems
_______________________________________________
hotspot-gc-use mailing list
hotspot-gc-use@openjdk.java.net
https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use