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

Tuning JVM options for throughput #2797

Merged
merged 1 commit into from
Apr 17, 2019

Conversation

DavidGregory084
Copy link
Member

@DavidGregory084 DavidGregory084 commented Apr 17, 2019

Changes the JVM options used by SBT somewhat.

Here is the reasoning for each change:

  • -Xmx4G - the Travis infrastructure that we're using has 7.5GB of memory, this could probably be increased further if forking tests was also disabled
  • removal of XX:-UseGCOverheadLimit - I think that this is just creating zombie builds that are stuck thrashing the GC and will timeout anyway due to lack of progress, better to fail early IMO
  • removal of -XX:+CMSClassUnloadingEnabled - this is relevant only for the CMS collector
  • switch from -XX:+UseConcMarkSweepGC to -XX:+UseParallelGC - from what I understand the concurrent CMS collector is a response time collector, whereas the parallel GC is a throughput collector (more on this in the Oracle docs), which is much more relevant for compiling code IMO

Here is some VisualVM output from running sbt clean test/clean catsJS/test, which normally stalls for me locally with the default options.

Before:

Screenshot 2019-04-17 at 12 43 29

Note that I had to kill this build as it got stuck.

After:

Screenshot 2019-04-17 at 12 43 37

Hopefully this will translate to improvements on Travis too! Who knows!

@DavidGregory084
Copy link
Member Author

One more comment about the choice of GC; the Scala compiler team noted performance regressions when moving to Java 9 due to the default GC changing from the ParallelGC (a throughput collector) to the GC1C (a response-time collector).

@codecov-io
Copy link

codecov-io commented Apr 17, 2019

Codecov Report

Merging #2797 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2797      +/-   ##
==========================================
- Coverage   94.28%   94.26%   -0.02%     
==========================================
  Files         367      367              
  Lines        6926     6927       +1     
  Branches      297      297              
==========================================
  Hits         6530     6530              
- Misses        396      397       +1

Continue to review full report at Codecov.

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

@DavidGregory084
Copy link
Member Author

DavidGregory084 commented Apr 17, 2019

EDIT: I'm looking at the wrong times in travis...

The first build took ~30min, which is consistent with other recent successful builds

Going to close and reopen to give it another go and see how consistent it is

@DavidGregory084
Copy link
Member Author

DavidGregory084 commented Apr 17, 2019

Second build took ~31min

On that basis I'm not sure this is going to yield any improvement in build times, but it may be less likely that builds will freeze on account of memory usage

@kailuowang
Copy link
Contributor

Thanks so much! @DavidGregory084, I am not an expert on concurrent CMS collector v.s. parallel GC, but I vote that we give it a try.

Copy link
Member

@tpolecat tpolecat left a comment

Choose a reason for hiding this comment

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

Cool, I need to try these options too!

@kailuowang kailuowang merged commit 788a0cf into typelevel:master Apr 17, 2019
@DavidGregory084 DavidGregory084 deleted the jvm-opts-tuning branch April 17, 2019 21:44
@kailuowang kailuowang added this to the 2.0.0-M1 milestone Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants