Android Studio 消耗大量 RAM

标签 android performance android-studio ram android-studio-3.0

我有配备 16 GB 内存的 MacBook Pro 15。我只是在 AndroidStudio 中运行一个项目,它需要大约 6 GB 的内存并使我的 MacBook 变慢。这太疯狂了,AndroidStudio 3.0 出现了严重的错误。

请查看屏幕截图,它有两个 java 实例,在没有模拟器的情况下占用了将近 3.5 GB 的 RAM。

这个问题有解决办法吗?我知道这个https://developer.android.com/studio/intro/studio-config.html#low_memory但我有 16 GB RAM,它应该可以顺利处理所有事情而无需调整。

出于某种原因,Apple 将 MacBook 的 RAM 容量限制为 16 GB,而 Android 占用了大部分内存,这让我很沮丧,因为我无法升级愚蠢的 RAM 或修复 Android Studio 内存问题。

AndroidStudio insane memory consumption for single project

最佳答案

对于 MacOS:

您可以使用 ulimit buildin shell 命令限制系统范围资源的使用

您可以了解更多关于 ulimit command here 的信息

对于 Windows: 你可以查看this

p.s: 讨论过类似的问题 here

关于Android Studio 消耗大量 RAM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48060286/

相关文章:

android - WebView:加载 url 时请求错误

android - 如何使用任何颜色格式从 MediaCodec 输出缩放 YUV 图像?

android - 使用 SharedPreferences 在 ListView 中保存 ToggleButton 状态

android - 从 android arsenal 添加存储库的问题

java - getText() 总是从动态创建的 Chip 组件返回空字符串?

c# - 生成集合的排列 - 高效且有区别

performance - 什么是完成大型重复性任务的最佳方法?

performance - BProlog 8.1 中的表格性能不均衡

android - 如何在Android中的WebView中显示网站的一部分

android - android studio 的 git.exe 错误