使用free命令查看弹性云主机的内存,为什么与实际不符? 本文主要介绍使用free命令查看弹性云主机的内存,为什么与实际不符? 问题描述 弹性云主机创建成功后,使用free m命令查询内存大小,查询结果与实际配置不符,较之创建时的配置要小一些。 示例: 假设创建该弹性云主机时,配置的实际内存大小为4194304KB(即4096MB)。创建完成后,使用free m命令查询内存大小,回显如下: [root@localhost ~] free m total used free shared buff/cache available Mem: 3790 167 3474 8 147 3414 Swap: 1022 0 1022 可以看到内存只有3790MB,小于实际的4096MB。 但是使用dmidecode t memory命令查看实际的硬件内存大小时,回显如下: [root@localhost ~] dmidecode t memory dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.8 present. Handle 0x1000, DMI type 16, 23 bytes Physical Memory Array Location: Other Use: System Memory Error Correction Type: Multibit ECC Maximum Capacity: 4 GB Error Information Handle: Not Provided Number Of Devices: 1 Handle 0x1100, DMI type 17, 40 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: Unknown Data Width: Unknown Size: 4096 MB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: Not Specified Type: RAM Type Detail: Other Speed: Unknown Manufacturer: QEMU Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Rank: Unknown Configured Clock Speed: Unknown Minimum Voltage: Unknown Maximum Voltage: Unknown Configured Voltage: Unknown 可以看到使用dmidecode t memory查看的内存大小与实际配置一致。