出现 Gradle 错误“无法为对象堆保留足够的空间"不断在 Intellij IDEA 中 [英] Getting Gradle error "Could not reserve enough space for object heap" constantly in Intellij IDEA
问题描述
所以我的内存分配有问题.有时它有效,有时它不起作用.我已经阅读了这个线程并尝试了多个建议次.有时 -Xms512m -Xmx768m
有效,有时 -Xms256m -Xmx512m
.我厌倦了不得不在 IntelliJ 中的 Build, Execution, Deployment > 下调整这个设置.构建工具摇篮>Gradle VM
选项设置.没有设置可以一劳永逸地解决这个问题吗?
So I have a problem with memory allocation. Sometimes it works, and sometimes it doesn't. I've read this thread and tried the advice there multiple times. Sometimes -Xms512m -Xmx768m
works, sometimes -Xms256m -Xmx512m
. I'm sick and tired of having to tweak this setting in IntelliJ under the Build, Execution, Deployment > Build Tools > Gradle > Gradle VM
options setting. Is there no setting that solves this once and for all?
我的 Windows 7 计算机上有 16GB 的 RAM,我运行的是 IntelliJ IDEA EAP 14 build 138.2210.3,64 位版本.Android Gradle 构建插件 v0.12.
I have 16GB of RAM on my Windows 7 computer, I'm running IntelliJ IDEA EAP 14 build 138.2210.3, 64 bit version. Android Gradle build plugin v0.12.
我怀疑 gradle 没有在 64 位模式下运行,否则它会有大约 7 GB 的可用内存可供使用.为什么不利用这个?
I'm suspecting gradle is not running in 64 bit mode, or else it would have ~7 GB of free memory to eat from. Why is it not utilizing this?
我在 Visual Studio 2015 和 cordova 5.1.1 在 Windows 10 下遇到了同样的错误.请参阅下面的我的解决方案.
I got the same error in Visual Studio 2015 with cordova 5.1.1 under Windows 10. See my solution below.
推荐答案
安装 64 位 Java 为我解决了
Installing 64 bit Java solved it for me
这篇关于出现 Gradle 错误“无法为对象堆保留足够的空间"不断在 Intellij IDEA 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!