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

Use ZGC for garbage collection #2951

Merged
merged 6 commits into from
Jun 11, 2023
Merged

Use ZGC for garbage collection #2951

merged 6 commits into from
Jun 11, 2023

Conversation

Sheikah45
Copy link
Member

On my system noticed the OS reported memory usage was halved

@Sheikah45 Sheikah45 temporarily deployed to deploy April 2, 2023 14:17 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Apr 2, 2023

Codecov Report

Merging #2951 (650f03c) into develop (b539935) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 650f03c differs from pull request most recent head cbcf770. Consider uploading reports for the commit cbcf770 to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2951      +/-   ##
=============================================
- Coverage      61.34%   61.33%   -0.01%     
  Complexity      4595     4595              
=============================================
  Files            557      557              
  Lines          20186    20186              
  Branches        1048     1048              
=============================================
- Hits           12383    12381       -2     
- Misses          7217     7219       +2     
  Partials         586      586              

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b539935...cbcf770. Read the comment docs.

@BlackYps
Copy link
Collaborator

BlackYps commented Apr 2, 2023

Halved? That's huge!

@magge-faf
Copy link
Collaborator

Yeah, that is amazing - have found no bugs so far, still testing it.

@Sheikah45
Copy link
Member Author

Yeah I ran through some tests with it. Still not entirely sure why. A lot of the memory used by the client is actually off heap, so it is rather hard to track down. So I was a little surprised when using the ZGC collector reported so much less memory usage. I am still investigating some as to why hence why this is not merged but figured I would send it out to be tested so others could confirm if it happened for them as well.

@Sheikah45
Copy link
Member Author

Sheikah45 commented Apr 2, 2023

And previously this "unknown" memory segment was partly due to the Webviews. But using the ZGC the os reported memory actually correlates with the heap+nonheap memory. Where as before ~500MB were due to either the GC or some other native memory purpose. But I do not know why anything other than the memory of the GC would change just from the GC change.

@@ -167,15 +167,11 @@ bootRun {
jvmArgs = [
"-DnativeDir=build/resources/native",
"-Dprism.forceGPU=true",
"-Xms128m",
"-Xmx712m",
"-Xmx1g",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With how ZGC operates it needs a little bit more heap overhead in order to operate properly without constantly performing concurrent GCs and kicking up CPU usage

Comment on lines 59 to 60
# Adjust maximum memory usage to 712MiB
-Xmx712m
-XX:ConcGCThreads=1
-XX:ParallelGCThreads=1
-XX:+UseG1GC
-Xmx1g
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment would also need to be adjusted (or just removed).

@Sheikah45 Sheikah45 merged commit b5fe27f into develop Jun 11, 2023
@Sheikah45 Sheikah45 deleted the maintenance/zgc branch June 11, 2023 01:32
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 this pull request may close these issues.

4 participants