Skip to content

GC latency #8045

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

Open
jeffcragg opened this issue Dec 17, 2023 · 7 comments
Open

GC latency #8045

jeffcragg opened this issue Dec 17, 2023 · 7 comments

Comments

@jeffcragg
Copy link

Serial GC Stop the World time on a single dev project, not particularly large or complex using libGDX Java framework for desktop applications.

[47.269s] GC(1) Full GC (Collect on allocation) 1025.39M->207.65M 472.288ms
[72.811s] GC(2) Full GC (java.lang.System.gc()) 752.15M->207.65M 273.472ms

This is unusable latency for graphical applications.

Integration of zgc or default options if available that reduce, or give the option to reduce stop the world to <4ms

Oracle will benefit from developers that can use Java for GUI applications, keeping the user-base and eco-system open and active.

The alternative is to not use graal native image, with a standby of zgc with low startup performance, or not use Java.

@SergejIsbrecht
Copy link

@jeffcragg , how is the behavior on OpenJDK with G1?

Maybe you could provide some kind of examples? Which GC settings were you using? As always, there are a lot of parameters to fine tune your application. I guess a reproducible would be best.

@alina-yur
Copy link
Member

hi @jeffcragg. If you want to optimize latency, the best option for Native Image is G1GC. With it, on Native Image you can get even better latency than on JIT + G1: https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee01177dd12d#f344

@jeffcragg
Copy link
Author

Hi thanks for the help. I try with
buildArgs.add("-R:MinHeapSize=4096M")
buildArgs.add("-R:MaxHeapSize=4096M")
buildArgs.add("-O3")
but I get
[44.927s] GC(2) Full GC (java.lang.System.gc()) 431.15M->208.65M 201.273ms
I am on Windows x64 so I can't try G1.

This feature request is because it seems that graal native priority trade-offs are between throughput, memory use, startup speed, but there is also I suggest a category of apps that prioritise low gc pausees -above all else- i.e. desktop apps.
So it would be great to have a fast startup+zgc (or Shenandoah or equivalent) for native and this doesn't seem to be on the roadmap.

@alina-yur
Copy link
Member

thank you @jeffcragg! I haven't noticed you're on Windows, indeed G1 is not available there yet, but we are working on it. Regarding ZGC, we added support on JIT, but it's not available on Native Image yet and there no immediate plans to add it yet. Thank you for your feedback, I passed it to the Native Image engineers.

@toinouH
Copy link

toinouH commented Dec 26, 2023

thank you @jeffcragg! I haven't noticed you're on Windows, indeed G1 is not available there yet, but we are working on it. Regarding ZGC, we added support on JIT, but it's not available on Native Image yet and there no immediate plans to add it yet. Thank you for your feedback, I passed it to the Native Image engineers.

Is the Generational mode of ZGGC available in the latest release ?
Thank you for your reading (and all the work you put in this project btw)

@alina-yur
Copy link
Member

thank you @toinouH! For now what is available (in GraalVM JIT) is the regular ZGC. We are working on Generational ZGC though, you can track the progress here: #8117

@fernando-valdez fernando-valdez self-assigned this Jan 11, 2024
@Ran-Mewo
Copy link

Hi, I was wondering if support for other GC will be added to native image for windows
At the moment native compiled Minecraft only seems nice for Linux AMD64 and AArch64 due to this limitation, windows just doesn't have the proper GC requirement for Minecraft.

I'd really love to have at least have G1GC be on windows native image

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

No branches or pull requests

6 participants