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

Start Gradle as lower priority process #1606

Closed
staffanf opened this issue Mar 17, 2017 · 6 comments
Closed

Start Gradle as lower priority process #1606

staffanf opened this issue Mar 17, 2017 · 6 comments
Assignees
Milestone

Comments

@staffanf
Copy link

There should an option to start gradle and it's daemon as a lower priority process to increase system responsiveness when running parallel tasks/threads.
I would argue that this should be the default.

Expected Behavior

Gradle should not hog all system resources at normal priority as a default. If the daemon is set to start with lower priority, very little performance is lost and system responsitivity increases a lot.

Current Behavior

Currently the wrapper starts gradle at normal priority, with or without the daemon. I would argue that the should be a choice, maybe in the wrapper setting to select default priority level for the gradle process that is started.

I would argue that the default for this should be low prio, but that is not as important as given the user the choice.

Context

My user environment and local VMs grid to a halt when I do heavy parallel compiles using gradle.
Running a parallel gradle build on my 8 thread/24GB/i7 developer machine makes Cinnamon (Linux Mint Window Manager) slow and my local guest virtual machine pretty much stand still.

Instead running: nice -n 15 ./gradlew --no-daemon --parallel build makes the user environment completely usable during the whole build and the performance loss is less than 10%.

Your Environment

Linux Mint, Ubuntu, Debian (all same results)

@DanielThomas
Copy link
Contributor

Given parallel workers and the general push towards parallel by default, this can only get worse. My MacBook is regularly a stuttering mess when I'm running builds, and I either have to limit the maximum workers or nice the process as @staffanf does. This'd be a great improvement.

@dylan-chong
Copy link

dylan-chong commented Jun 2, 2018

This issue is super important to me! I really hate having my system stutter just because I am running a gradle build.

And an important thing to mention is that on Mac OS nice is broken (Apple knows about this) so for the meantime we can't even run nice -n 15 ... :(

@oehme oehme added a:performance-issue and removed a:feature A new functionality labels Aug 3, 2018
@oehme oehme added this to the 5.0 RC1 milestone Aug 7, 2018
@oehme
Copy link
Contributor

oehme commented Aug 7, 2018

If we want to change the default, 5.0 would be a good point to do that. We should do some measurements to see the impact on default performance vs default usability.

@oehme oehme modified the milestones: 5.0 M1, 5.0 RC1 Oct 1, 2018
@oehme oehme self-assigned this Oct 1, 2018
@oehme
Copy link
Contributor

oehme commented Oct 16, 2018

For 5.0, I'm going to add an option that you can configure in your user home. Once we have some positive experience with this, we can add auto-detection, e.g. based on whether Gradle is attached to a console.

@sarnobat
Copy link

sarnobat commented Jul 9, 2021

Question: does --parallel make things worse? What about --daemon? I'm on Gradle 4.8.1 (not my choice). My machine is unusable when I run gradle and I am trying to narrow down what's causing it.

@TWiStErRob
Copy link
Contributor

For anyone finding this, see docs:

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

7 participants