Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[问题] 使用Gradle编译apk,报OutOfMemoryError: GC overhead limit exceeded #26

Closed
fxleyu opened this issue Nov 15, 2017 · 1 comment
Assignees
Labels
Projects

Comments

@fxleyu
Copy link
Owner

fxleyu commented Nov 15, 2017

如题,具体log摘要如下:

Problem in daemon expiration check
java.lang.OutOfMemoryError: GC overhead limit exceeded
	at java.util.Arrays.copyOfRange(Arrays.java:3664)
	at java.lang.String.<init>(String.java:207)
	at java.lang.String.substring(String.java:1969)
	at java.io.File.getParent(File.java:479)
	at java.io.File.getParentFile(File.java:499)
	at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.<init>(DefaultFileLockManager.java:133)

有时如下:

系统资源不足。
有关详细信息, 请参阅以下堆栈跟踪。
java.lang.OutOfMemoryError: GC overhead limit exceeded
	at com.sun.tools.javac.code.Scope$ImportScope.makeEntry(Scope.java:530)
	at com.sun.tools.javac.code.Scope.enter(Scope.java:220)
	at com.sun.tools.javac.comp.MemberEnter$4.importFrom(MemberEnter.java:326)
	at com.sun.tools.javac.comp.MemberEnter$4.run(MemberEnter.java:334)
	at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:143)
	at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
	at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)

还有其他的,基本都是OOME错误。

@fxleyu fxleyu changed the title [问题] 使用Gradle编译apk,报 [问题] 使用Gradle编译apk,报OutOfMemoryError: GC overhead limit exceeded Nov 18, 2017
@fxleyu
Copy link
Owner Author

fxleyu commented Nov 18, 2017

解决方案

./gradle/gradle.properties 文件中,添加如下参数

org.gradle.jvmargs=-Xmx1536m

参考

@fxleyu fxleyu closed this as completed Nov 18, 2017
@fxleyu fxleyu self-assigned this Nov 18, 2017
@fxleyu fxleyu added the 问题 label Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
问题
Awaiting triage
Development

No branches or pull requests

1 participant