Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Drop -XX:+UseParallelGC #282

Merged
merged 1 commit into from
Sep 19, 2019
Merged

Drop -XX:+UseParallelGC #282

merged 1 commit into from
Sep 19, 2019

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Sep 18, 2019

Fixes sbt/sbt#5045
Ref sbt/sbt#3559

Currently we set -XX:+UseParallelGC for JDK greater than 9. This isn't a great default because while the peak throughput is somewhat better than the default g1 collector, the worst case performance is really bad with UseParallelGC, especially when the heap size is large.

Given the sudden diversification of JDK implementations, we should stay clear from -XX flags, and let the build users add them if they must.

note

Since there are concerns that we are undoing #189, here's some adhoc local testing.

scala/scala

## g1gc
git clean -fdx && time java -Dfile.encoding=UTF-8 -Xms2048M -Xmx2048M -Xss2M -jar /usr/local/Cellar/sbt/1.3.0/libexec/bin/sbt-launch.jar ";clean;compile;clean;compile;clean;compile"
java -Dfile.encoding=UTF-8 -Xms2048M -Xmx2048M -Xss2M -jar    858.97s user 24.13s system 322% cpu 4:34.00 total

## parallel gc
git clean -fdx && time java -Dfile.encoding=UTF-8 -Xms2048M -Xmx2048M -Xss2M -XX:+UseParallelGC -jar /usr/local/Cellar/sbt/1.3.0/libexec/bin/sbt-launch.jar ";clean;compile;clean;compile;clean;compile"
java -Dfile.encoding=UTF-8 -Xms2048M -Xmx2048M -Xss2M -jar    745.71s user 21.74s system 282% cpu 4:32.06 total

gcg1 is 1% slower.

ThoughtWorksInc/Dsl.scala

## g1gc
git clean -fdx && time java -Dfile.encoding=UTF-8 -Xms2048M -Xmx2048M -Xss2M -jar /usr/local/Cellar/sbt/1.3.0/libexec/bin/sbt-launch.jar ";clean;compile;clean;compile;clean;compile"
java -Dfile.encoding=UTF-8 -Xms2048M -Xmx2048M -Xss2M -jar    439.78s user 20.47s system 555% cpu 1:22.90 total

## parallel gc
git clean -fdx && time java -Dfile.encoding=UTF-8 -Xms2048M -Xmx2048M -Xss2M -XX:+UseParallelGC -jar /usr/local/Cellar/sbt/1.3.0/libexec/bin/sbt-launch.jar ";clean;compile;clean;compile;clean;compile"
java -Dfile.encoding=UTF-8 -Xms2048M -Xmx2048M -Xss2M -jar    441.60s user 20.45s system 550% cpu 1:23.87 total

gcg1 is 1% faster.

Fixes sbt/sbt#5045

Currently we set `-XX:+UseParallelGC` for JDK greater than 9. This isn't a great default because while the peak throughput is somewhat better than the default g1 collector, the worst case performance is really bad with UseParallelGC, especially when the heap size is large.

Given the sudden diversification of JDK implementations, we should stay clear from `-XX` flags, and let the build users add them if they must.
Copy link
Contributor

@eatkins eatkins left a comment

Choose a reason for hiding this comment

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

LGTM. We should just be sure to loudly point this out in the release notes.

@eed3si9n eed3si9n merged commit 577cdb8 into sbt:master Sep 19, 2019
@eed3si9n eed3si9n deleted the wip/gc branch September 19, 2019 20:15
@eed3si9n eed3si9n mentioned this pull request Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sbt sets -XX:+UseParallelGC for jdk >= 9
2 participants