首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Linux上使用Android 4优化用于Android开发的4GB RAM

在Linux上使用Android 4优化用于Android开发的4GB RAM
EN

Ask Ubuntu用户
提问于 2020-07-06 05:37:50
回答 1查看 1.2K关注 0票数 0

我正在使用Android Studio 4 on Ubuntu 20.04 LTS和Intel Corei3处理器(Intel® Core™ i3-2120 CPU @ 3.30GHz × 4)。启动Android后,90%以上的物理内存被使用。我甚至不使用任何虚拟设备与它,但连接我的android手机通过USB到我的电脑。

我运行了一个Hard Disk Health CheckMemtest86,以确保内存和硬盘没有故障。这两份报告都没有任何错误。

硬盘健康检查:

代码语言:javascript
复制
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   136   136   054    Pre-fail  Offline      -       93
  3 Spin_Up_Time            0x0007   121   121   024    Pre-fail  Always       -       190 (Average 190)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       3937
  5 Reallocated_Sector_Ct   0x0033   096   096   005    Pre-fail  Always       -       249
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   115   115   020    Pre-fail  Offline      -       34
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       4904
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       3937
192 Power-Off_Retract_Count 0x0032   097   097   000    Old_age   Always       -       4568
193 Load_Cycle_Count        0x0012   097   097   000    Old_age   Always       -       4568
194 Temperature_Celsius     0x0002   181   181   000    Old_age   Always       -       33 (Min/Max 18/49)
196 Reallocated_Event_Count 0x0032   093   093   000    Old_age   Always       -       310
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

完整报告为这里

Memtest86:

studio64.vmoptions:

代码语言:javascript
复制
# Runs JVM in Server mode with more optimizations and resources usage
# It may slow down the startup, but if you usually keep IDE running for few hours/days
# JVM may profile and optimize IDE better. Feel free to remove this flag.
# -server

#Sets the initial memory allocation pool
-Xms512m

#Sets the maximum  memory allocation pool
-Xmx1G

# Sets the size of the allocated class metadata space that will trigger a GC the first time it
# is exceeded, default max value is 350m
-XX:MetaspaceSize=512m

问题:

如何优化物理内存,或者是否真的需要考虑增加系统内存(RAM)?

我已经通过了的帖子,但真的寻找如果我们有任何其他的解决办法。

编辑:

自由.h输出

代码语言:javascript
复制
              total        used        free      shared  buff/cache   available
Mem:          3.5Gi       3.0Gi       122Mi       136Mi       405Mi       161Mi
Swap:         2.0Gi       675Mi       1.3Gi
EN

回答 1

Ask Ubuntu用户

发布于 2020-07-06 06:17:22

您可以考虑使用Power save mode (文件->电源保存模式)

一定要使用物理设备进行测试。最后,将最大堆大小减少到较小的值(帮助->更改内存设置)

希望这能有所帮助。

编辑:由于您已经更改了内存设置,省电模式可以帮助您。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1256692

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档