美文网首页
android7.1 编译提示Out of memory err

android7.1 编译提示Out of memory err

作者: 令小狐先生 | 来源:发表于2019-11-23 14:18 被阅读0次

    android7.1 编译systemimage的时候,遇到编译报错

    FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp

    Out of memory error (version 1.2-rc4 'Carnac' (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by android-jack-team@google.com)).

    GC overhead limit exceeded.

    Try increasing heap size with java option '-Xmx<size>'.

    Warning: This may have produced partial or corrupted output.

    ninja: build stopped: subcommand failed.

    make: *** [ninja_wrapper] Error 1

    需要增加Java虚拟机的-Xmx大小,即设置一个较大的堆内存上限

    方法1:

       修改Jack的配置文件prebuilts/sdk/tools/jack-admin

    JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS -cp $LAUNCHER_JAR $LAUNCHER_NAME"

    修改为

    JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS -Xmx4096m -cp $LAUNCHER_JAR $LAUNCHER_NAME"

    然后

    重新启动jack-server

    #先停止服务

    ./prebuilts/sdk/tools/jack-admin stop-server

    #重新开始服务.

    /prebuilts/sdk/tools/jack-admin start-server

    方法2:

    export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation  -Xmx4096m"

    然后重新其中jack-server

    参考网站:

    https://www.cnblogs.com/dinphy/p/6138803.html

    相关文章

      网友评论

          本文标题:android7.1 编译提示Out of memory err

          本文链接:https://www.haomeiwen.com/subject/dddhwctx.html