Build time peak on every 4th iteration
See original GitHub issueI observe strange behavior because on every 4th clean build iteration I receive 10-30% build time peak. It occurs only on long time builds for at least 3 mins.
I run this benchmark via:
gradle-profiler --benchmark --scenario-file build-time_clean-change.scen
with this scenario:
clean_build_change {
title = "Clean Build with changes Xmx12g"
tasks = [":app:buildDebug"]
gradle-args = ["--parallel"]
cleanup-tasks = ["clean"]
jvm-args = ["-Xmx12g"]
warm-ups = 4
iterations = 10
apply-abi-change-to = "app/src/main/java/com/awesome/app/MainActivity.kt"
apply-android-resource-change-to = "app/src/main/res/values/strings.xml"
}
Tested on hardware: i7-8550U, 256 GB SSD (Toshiba 2280), 16 GB DDR4
I tried to use different -Xmx
parameter but without any significant changes. Did you have any other suggestions?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to go about doing something every fourth loop as well as ...
I can add a condition to make things happen every two loops, but how do I create a condition for every fourth loop?...
Read more >every 4th iteration is very slow #5328 - iperov/DeepFaceLab
Actual behavior. ****Every 4th iteration/epoch gets stuck for some time. i have narrowed it down to the fact that , the bigger (...
Read more >Data loader takes a lot of time for every nth iteration
Apparently it takes each worker more than 20 seconds to pull 128 samples from the server, while each training step is much faster....
Read more >Iterations - Scaled Agile Framework
Iterations are the basic building block of Agile development. Each iteration is a standard, fixed-length timebox, where Agile Teams deliver ...
Read more >Iterations - GitLab Docs
Iterations are a way to track issues over a period of time. ... You can use them to automate creating iterations every 1,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, yeh in hindsight I should have done that in the first place as my comment wasn’t very helpful, my bad 🤦
I managed to figure out it was due to the remote build caches being enabled, and for whatever reason these increase builds were taking longer than usual to upload to the remote cache.
I cannot say this is the reason for the original author of this issue but what I will suggest trying is the same steps I took to work it out:
gradle-args = ["--scan"]
to each scenariobuild.gradle
to accept the terms and conditions automaticallyprofile.log
file search forPublishing build scan...
until you find the one associated with the anomaly buildMy first guess would be that gc kicks in, so there is a gc pause. And then JVM increases the heap size and it’s better on the next runs. I would suggest you also set
-Xms
(initial heap size), since-Xmx
is just the maximum heap that process can use and JVM starts with much less at the beginning (I don’t know from my head what is the default value for the-Xms
).You can also try to use
--measure-gc
forgradle-profiler
so you can see somegc
benchmarks.