gpt4 book ai didi

linux - linux下free的结果和dmidecode的结果有什么区别?

转载 作者:太空宇宙 更新时间:2023-11-04 05:26:49 27 4
gpt4 key购买 nike

我使用两个工具来收集我的内存信息,dmidecode和free,两者显示不同的结果,dmidecode显示我的内存是4096MB,free -m显示的是3829,有什么不同以及为什么?

Handle 0x0083, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0082
Error Information Handle: No Error
Total Width: 32 bits
Data Width: 32 bits
Size: 4096 MB
Form Factor: DIMM
Set: None
Locator: RAM slot #0
Bank Locator: RAM slot #0
Type: DRAM
Type Detail: EDO
Speed: Unknown
Manufacturer: Not Specified
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

free -m 输出:

             total       used       free     shared    buffers     cached
Mem: 3829 3566 262 0 495 1779
-/+ buffers/cache: 1291 2537
Swap: 8191 0 8191

最佳答案

dmidecode 使用 BIOS 工具(特别是 smbios)来获取系统中物理存在的内存量。系统启动时,BIOS 根据 DIMM 模块上的 SPD 芯片确定其大小。

但是在启动过程中,BIOS 本身保留了一些内存(即用于嵌入式显卡的视频 RAM),因此提供给操作系统的内存量要小一些,这就是您在 free 输出中看到的内容。

通常你可以从dmesg输出中检查它:

[    0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009e000 (usable)
[ 0.000000] BIOS-e820: 000000000009e000 - 00000000000a0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
[ 0.000000] BIOS-e820: 0000000000100000 - 00000000bd92a000 (usable)
[ 0.000000] BIOS-e820: 00000000bd92a000 - 00000000bd94c000 (ACPI NVS)
...

关于linux - linux下free的结果和dmidecode的结果有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30033141/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com