Android Studio - 如何增加分配的堆大小 [英] Android Studio - How to increase Allocated Heap Size

查看:1574
本文介绍了Android Studio - 如何增加分配的堆大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Android Studio 3个月了,我开始使用的一个应用程序已经变得相当大。程序右下角显示的内存使用情况说明我分配的堆最大为494M。

I've been using Android Studio for 3 months now and one of the apps I started on it has become fairly large. The memory usage indicated at the bottom right of the program says my allocated heap is maxed at 494M.

当我开始更改XML文件时,我的内存使用率迅速达到了上限,IDE崩溃内存不足错误。

When I start to change the XML files my memory usage quickly reaches that cap and the IDE crashes with an Out Of Memory error like this.

我试图使用这个增加堆大小,但到目前为止没有效果。

I've tried to increase the heap size using this but so far there has been no effect.

我已经看过几十篇文章和其他关于如何增加堆大小的问题,但他们的答案没有工作。无论我对VMOPTIONS或IDE设置做什么,堆大小都不会增加。我相信我编辑正确的文件为VMOPTIONS,因为如果我故意给它一个无效的命令Android Studio抱怨,并没有开始。

I've looked at dozens of articles and other questions on how to increase the heap size but none of their answers are working. No matter what I do to the VMOPTIONS or the IDE settings the heap size never increases. I believe I am editting the correct file for the VMOPTIONS because if I purposely give it an invalid command Android Studio complains about it and doesn't start.

我使用Windows 7 - 64位和16 GB RAM。
有任何人有Android Studio的这个问题吗?你能修复它吗?

I'm using windows 7 - 64 bit and have 16GB RAM. Has anyone else had this problem with Android Studio? And were you able to fix it?

推荐答案

我查看了我的环境变量,并有一个系统变量 _JAVA_OPTIONS -Xms256m -Xmx512m 值更改为 -Xms256m -Xmx1024m 后,最大堆大小也相应增加。

I looked at my Environment Variables and had a System Variable called _JAVA_OPTIONS with the value -Xms256m -Xmx512m, after changing this to -Xms256m -Xmx1024m the max heap size increased accordingly.

这篇关于Android Studio - 如何增加分配的堆大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆