java – 在Ubuntu 15.10上构建android源代码时增加堆大小
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了java – 在Ubuntu 15.10上构建android源代码时增加堆大小,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3770字,纯文字阅读大概需要6分钟。
内容图文
![java – 在Ubuntu 15.10上构建android源代码时增加堆大小](/upload/InfoBanner/zyjiaocheng/952/a7b5b61cc07549babcc636c693b3ede0.jpg)
我试图在ubuntu 15.10中构建android源代码,但是我收到了一个错误.现在我希望你的帮助来构建android源代码.
including ./tools/external/fat32lib/Android.mk ...
Starting build with ninja
ninja: Entering directory `.'
[ 0% 1/21542] Ensure Jack server is installed and started
Jack server already installed in "/home/smile/.jack-server"
Server is already running
[ 0% 2/21542] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/with-local/classes.dex
FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/with-local/classes.dex.rsp
Java heap space
Try increasing heap size with java option '-Xmx<size>'
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:146: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (08:25 (mm:ss)) ####
然后我运行“$java -Xmx2048m”命令,我得到一些代码:
smile@smile:~/Android$java -Xmx2048m
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
-zero to select the "zero" VM
-jamvm to select the "jamvm" VM
-avian to select the "avian" VM
-dcevm to select the "dcevm" VM
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
谁能帮我如何增加堆大小?
你的帮助会非常适合我
提前致谢.
smile@smile:~/Android$java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.3) (7u91-2.6.3-0ubuntu0.15.10.1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
解决方法:
我遇到了同样的问题.
问题是运行插孔的虚拟机没有足够的内存.
您可以尝试编辑jvm命令:
JACK_VM_COMMAND=${JACK_VM_COMMAND:="java -Xmx4096m"}
或减少并行插孔编号的数量
SERVER_NB_COMPILE=2
在?/ .jack文件中.
有关详细信息,请阅读jack documentation.
编辑:
更改.jack文件对我不起作用.
在深入挖掘后,我发现jack服务器是以/ host / linux-x86 / bin / jack-admin脚本启动的,它的参数可以通过JACK_SERVER_VM_ARGUMENTS环境变量传递.
所以我的解决方案是在构建aosp之前设置它并重新启动jack服务器:
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
out/host/linux-x86/bin/jack-admin kill-server
out/host/linux-x86/bin/jack-admin start-server
内容总结
以上是互联网集市为您收集整理的java – 在Ubuntu 15.10上构建android源代码时增加堆大小全部内容,希望文章能够帮你解决java – 在Ubuntu 15.10上构建android源代码时增加堆大小所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。