Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail threshold for GC #183

Closed
eugene-krivobokov opened this issue Dec 10, 2021 · 0 comments · Fixed by #185
Closed

Fail threshold for GC #183

eugene-krivobokov opened this issue Dec 10, 2021 · 0 comments · Fixed by #185

Comments

@eugene-krivobokov
Copy link
Contributor

eugene-krivobokov commented Dec 10, 2021

Current use case

Using GCWarningThreshold highlights the problems in some scenarios.
Unfortunately, users rarely notice it. We react to this only after some time.

I'd like to answer to possible questions in advance:

Why can't we just increase Xmx one time?

  1. It's not obvious how to choose the best value for all users.

We have a big mono repository with multiple apps.
Choosing Xmx for the worst scenario looks controversial:

  • It depends on scenarios. Some are heavy and rarely used.
  • Some users have lower RAM sizes
  • It depends on parallelism - Gradle max workers
  1. It's a reactive approach with monitoring warnings with unpredicted lag.

The value must be reevaluated after any significant change in the project (AGP, Gradle, Kotlin, ... versions, and so on) and while growing the codebase.

Why can't we just use -XX:+UseParallelGC -XX:+UseGCOverheadLimit -XX:GCTimeLimit=N?

In our benchmarks, G1 somehow shows better performance results than ParallelGC.
Also, ParallelGC can't shrink unused memory and return it to the OS (Java 11)

Proposed use case

Add an option to fail the build:

GCFailThreshold = 0.9f

It will give a strong signal to decide what to do.
Thus we won't need to monitor warnings. The final goal is to have stronger guarantees about not wasting time in GC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant