Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Gradleの実行環境設定を見直す
Search
Yoshihiro WADA
January 19, 2024
Programming
0
720
Gradleの実行環境設定を見直す
2024/1/19に開催されたshibuya.apk #46で発表した「Gradleの実行環境設定を見直す」のスライドです
Yoshihiro WADA
January 19, 2024
Tweet
Share
More Decks by Yoshihiro WADA
See All by Yoshihiro WADA
Firebase App Distributionのテストアプリ配信を試しやすくする
e10dokup
0
500
アプリに署名する 〜GitHub ActionsでのCIも見据えて〜
e10dokup
0
1.1k
Profileable buildでより正確なパフォーマンスを掴む
e10dokup
0
680
[DroidKaigi 2021] メディアアクセス古今東西 / Now and Future of Media Access
e10dokup
0
3.2k
今更「dp」を考える / Let's think about "dp" now
e10dokup
0
5.4k
1から学ぶAndroidアプリデバッグ - アプリの動作を追いかけよう / Learn Android application debugging from the scratch - track apps' behaviors
e10dokup
10
3k
Guide to background processingを読んでみる / Reading "Guide to background processing"
e10dokup
0
250
よしなに頑張る画像ロードの話 / image load mettya tsurai
e10dokup
2
470
WorkManager Stableに向けての所感
e10dokup
2
420
Other Decks in Programming
See All in Programming
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Jakarta EE meets AI
ivargrimstad
0
140
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
CSC509 Lecture 09
javiergs
PRO
0
140
CSC509 Lecture 11
javiergs
PRO
0
180
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
890
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
The Invisible Side of Design
smashingmag
298
50k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
What's in a price? How to price your products and services
michaelherold
243
12k
Writing Fast Ruby
sferik
627
61k
Being A Developer After 40
akosma
86
590k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
RailsConf 2023
tenderlove
29
900
The Language of Interfaces
destraynor
154
24k
Transcript
Gradle Yoshihiro Wada / @e10dokup 2024/01/19 @ Shibuya.apk #46
{ “id”: “@e10dokup”, “name”: “Yoshihiro Wada”, “affiliations”: [ “CyberAgent Inc,
/ Ameba” ], “interested”: [ “camera”, “gadget”, “driving”, “motorsports” ] }
Android Gradle Gradle JVM 3
Android Gradle
Android Studio Gradle release debug Staging/Production APK/AAB Android Gradle Android
Gradle Plugin AGP Android Gradle 5
Gradle JVM Groovy Gradle JVM Gradle Gradle Gradle JVM Gradle
6
None
Android --build-cache gradle.properties GRADLE_OPTS CI GRADLE_OPTS: ʢઃఆʙʙʣ Gradle 8
Gradle 9 Ҿ༻ݩɿhttps://docs.gradle.org/current/userguide/build_environment.html
CI GRADLE_OPTS CI gradle.properties GRADLE_OPTS JVM GRADLE_OPTS JVM_OPTS 10
None
Android Studio Android SDK AGP AGP 8 R AGP Android
Studio 12
AndroidX •android.enableJetifier=false Build Analyzer Jeti fi er 13
R R •android.nonTransitiveRClass=true AGP 8.0.0 10~20% Android Studio [Refactor] >
[Migrate to Non-Transitive R Classes … ] R 14
Con fi guration •org.gradle.configuration-cache=true •org.gradle.configuration-cache.problems=warn Con fi guration Build Analyzer
Con fi guration Cache Con fi guration Cache 15
Gradle JVM •org.gradle.jvmargs=-XX:+UseParallelGC •org.gradle.jvmargs=-Xmx4096M Gradle JVM org.gradle.jvmargs 16
Gradle JVM
CI Common Android memory issues CI 1 OS 75% RAM
20GB 15GB PC Android Studio PC Android Studio RAM 16GB JVM 18
org.gradle.jvmargs 19 org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options=-Xmx2g
-Xmx JVM Android Developers 4/6/8GB Gradle JVM -Xms org.gradle.jvmargs 20
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options=-Xmx2g
-XX:MaxMetaspaceSize Metaspace Gradle Gradle Plugin OOM 256m 384m Android org.gradle.jvmargs
21 org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options=-Xmx2g
-Dkotlin.daemon.jvm.options Kotlin Daemon Kotlin Daemon Gradle org.gradle.jvmargs Gradle OOM org.gradle.jvmargs
22 org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options=-Xmx2g
Kotlin 23 Kotlin Gradle Daemon kotlin.compiler.execution.strategy daemon default Kotlin Daemon
in-process Gradle Daemon Gradle out-of-process Gradle
PC CI Gradle 2-3 GRADLE_OPTS gradle.properties Gradle Daemon RAM 20GB
4GB 24
https://developer.android.com/build/optimize-your-build Optimize your build speed Android Developers https://support.circleci.com/hc/en-us/articles/360021812453- Common-Android-memory-issues Common
Android Memory Issues Circle CI https://qiita.com/irgaly/items/4c22d233caf8ec55512e Android: GitHub Actions Gradle build daemon disappeared unexpectedly Qiita References 25