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
900
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
AndroidデバイスにFTPサーバを建立する
e10dokup
0
290
Firebase App Distributionのテストアプリ配信を試しやすくする
e10dokup
0
580
アプリに署名する 〜GitHub ActionsでのCIも見据えて〜
e10dokup
0
1.1k
Profileable buildでより正確なパフォーマンスを掴む
e10dokup
0
720
[DroidKaigi 2021] メディアアクセス古今東西 / Now and Future of Media Access
e10dokup
0
3.5k
今更「dp」を考える / Let's think about "dp" now
e10dokup
0
5.6k
1から学ぶAndroidアプリデバッグ - アプリの動作を追いかけよう / Learn Android application debugging from the scratch - track apps' behaviors
e10dokup
10
3.2k
Guide to background processingを読んでみる / Reading "Guide to background processing"
e10dokup
0
250
よしなに頑張る画像ロードの話 / image load mettya tsurai
e10dokup
2
490
Other Decks in Programming
See All in Programming
OUPC2024 Day 1 解説
kowerkoint
0
400
Firebase Dynamic Linksの代替手段を自作する / Create your own Firebase Dynamic Links alternative
kubode
0
180
아직도 SOLID 를 '글'로만 알고 계신가요?
sh1mj1
0
360
安全に倒し切るリリースをするために:15年来レガシーシステムのフルリプレイス挑戦記
sakuraikotone
5
2.4k
Defying Front-End Inertia: Inertia.js on Rails
skryukov
0
150
英語 × の私が、生成AIの力を借りて、OSSに初コントリビュートした話
personabb
0
110
Compose Navigation実装の見通しを良くする
hiroaki404
0
180
신입 안드로이드 개발자의 AI 스타트업 생존기 (+ Native C++ Code를 Android에서 사용해보기)
dygames
0
510
パスキーのすべて / 20250324 iddance Lesson.5
kuralab
0
130
Preact、HooksとSignalsの両立 / Preact: Harmonizing Hooks and Signals
ssssota
1
770
php-fpm がリクエスト処理する仕組みを追う / Tracing-How-php-fpm-Handles-Requests
shin1x1
5
840
20250326_生成AIによる_レビュー承認システムの実現.pdf
takahiromatsui
17
5.6k
Featured
See All Featured
Fireside Chat
paigeccino
37
3.3k
Code Review Best Practice
trishagee
67
18k
BBQ
matthewcrist
88
9.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Faster Mobile Websites
deanohume
306
31k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
Typedesign – Prime Four
hannesfritz
41
2.6k
Adopting Sorbet at Scale
ufuk
75
9.3k
A designer walks into a library…
pauljervisheath
205
24k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
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