我正在使用Android Studio 4
Intel Ubuntu 20.04 LTS
Corei3 处理器 ( Intel® Core™ i3-2120 CPU @ 3.30GHz × 4
)。启动 Android Studio 后,超过 90% 的物理内存被使用。我甚至没有使用任何虚拟设备,而是通过 USB 将我的 Android 手机连接到我的电脑。
我已运行Hard Disk Health Check
和 Memtest86
以确保 RAM 和硬盘没有故障。这两项均未报告任何错误。
硬盘健康检查:
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.vm选项:
# 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)?
我经历过这发布但确实想知道我们是否还有其他解决方法。
编辑:
free.h 输出
total used free shared buff/cache available
Mem: 3.5Gi 3.0Gi 122Mi 136Mi 405Mi 161Mi
Swap: 2.0Gi 675Mi 1.3Gi