admin管理员组文章数量:1387404
I'm facing an issue with Gradle builds failing on our Azure Pipelines CI/CD setup due to insufficient memory. The VM we use has 16GB of RAM, but at certain points during the build, it runs out of resources and crashes.
Is it normal for an Android build to require more than 16GB of RAM? Are there any optimizations I can make on my end as an Android developer to reduce memory usage?
In case it helps, in my application, I make use of dagger hilt and it is single module. Any insights or suggestions would be greatly appreciated!
I'm facing an issue with Gradle builds failing on our Azure Pipelines CI/CD setup due to insufficient memory. The VM we use has 16GB of RAM, but at certain points during the build, it runs out of resources and crashes.
Is it normal for an Android build to require more than 16GB of RAM? Are there any optimizations I can make on my end as an Android developer to reduce memory usage?
In case it helps, in my application, I make use of dagger hilt and it is single module. Any insights or suggestions would be greatly appreciated!
Share Improve this question asked Mar 17 at 9:36 Nontas PapadopoulosNontas Papadopoulos 211 silver badge4 bronze badges 1- Hi @NontasPapadopoulos, Good day. If the answer below may help resolve the issue in this post, please consider this, which may help other community members with similar concerns. Thx for the sharing. – Aguy Commented Mar 20 at 2:43
1 Answer
Reset to default 1Android builds can be memory hogs, especially with Dagger Hilt, Kotlin, and large projects. But 16GB should usually be enough if managed properly.
You can set these settings which can help you prevent OOM (basically limit gradle usage)
.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
.gradle.parallel=true
.gradle.daemon=true
.gradle.configureondemand=true
.gradle.caching=true
Usually Azure VMS also have limited cores, you can also limit the thread spawns
.gradle.workers.max=2
Also I would recommend you to move to a multi module approach, which only builds whats needed, inspite of whole app module.
本文标签: androidGradle Build Failing on Azure Pipelines Due to RAM LimitationsStack Overflow
版权声明:本文标题:android - Gradle Build Failing on Azure Pipelines Due to RAM Limitations - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744569718a2613262.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论