通过Gradle构建项目时JVM空间已耗尽 [英] JVM space exhausted when building a project through gradle
本文介绍了通过Gradle构建项目时JVM空间已耗尽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
通过gradle构建项目时收到错误消息
Receiving error message when building a project through gradle
守护进程到期,因为JVM占用的空间已耗尽
Expiring Daemon because JVM Tenured space is exhausted
推荐答案
这意味着JVM没有足够的内存来编译Java文件.可以采取几个步骤.
This means the JVM doesn't have enough memory to compile the Java files. There's a couple of steps that can be taken.
- 运行
./gradlew clean
,这将删除所有与以前的版本不再相关的内容,包括剩余的内容. - 运行
./gradlew --stop
,杀死可能占用内存的其他gradle守护程序. - 分配更多的内存.这可以通过将以下内容添加到
gradle.properties
文件中来完成.
- Run
./gradlew clean
, which will remove everything including leftovers from previous builds which are no longer relevant. - Run
./gradlew --stop
, killing other gradle daemons which may be taking up memory. - Allocate more memory. This can be done by adding the following to the
gradle.properties
file.
org.gradle.jvmargs = -Xms128m -Xmx1024m -XX:+ CMSClassUnloadingEnabled
org.gradle.jvmargs=-Xms128m -Xmx1024m -XX:+CMSClassUnloadingEnabled
这篇关于通过Gradle构建项目时JVM空间已耗尽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文