IT虾米网

Linux查看物理内存信息详解

sanshao 2021年07月15日 程序员 205 0

Linux查看物理内存信息

1. 查看内存大小

dmidecode|grep Size 

输出

Runtime Size: 64 kB 
ROM Size: 4608 kB 
Installed Size: 1024 kB 
Maximum Size: 1024 kB 
Installed Size: 256 kB 
Maximum Size: 256 kB 
Installed Size: 8192 kB 
Maximum Size: 8192 kB 
        PSE (Page size extension) 
        PSE-36 (36-bit page size extension) 
Descriptor 7: POST memory resize 
Size: No Module Installed 
Size: 8192 MB 
Range Size: 8 GB 
Size: No Module Installed 
Size: 8192 MB 
Range Size: 8 GB 
Range Size: 16 GB 
 

看里面有两个Size的,有两条,一共16G

2. 查看内存速率

dmidecode|grep Speed 
 

输出

Nominal Speed: Unknown Or Non-rotating 
Nominal Speed: Unknown Or Non-rotating 
Nominal Speed: Unknown Or Non-rotating 
Speed: Unknown 
Speed: Unknown 
Speed: Unknown 
Max Speed: 3800 MHz 
Current Speed: 3200 MHz 
Speed: Unknown 
Speed: 1600 MHz 
Speed: Unknown 
Speed: 1600 MHz 
 

可以看到速率是1600MHz

3. 查看内存类型

dmidecode|grep DDR 

输出

Type: DDR3 
Type: DDR3 
 

然而,在某些机器上可能没输出,则按照速率来判断。
内存速率和型号对应关系

DDR 266/333/400	 
DDR2 533/667/800	 
DDR3 1066/1333/1600	 
 

4. 查看ECC内存

ECC (error-correcting code) RAM is essential in servers and many workstations as it dramatically improves the reliability of the system's memory by detecting common kinds of data corruption and fixing the errors automatically. Without the error correction of ECC memory, memory errors can cause data corruption or even blue screens.
命令

dmidecode -t memory 
 

输出

Handle 0x003D, DMI type 17, 27 bytes 
Memory Device 
        Array Handle: 0x003B 
        Error Information Handle: Not Provided 
        Total Width: 72 bits 
        Data Width: 64 bits 
        Size: 2048 MB 
        Form Factor: DIMM 
        Set: None 
        Locator: DIMM_A1 
        Bank Locator: NODE 0 CHANNEL 0 DIMM 0 
        Type: Other 
        Type Detail: Synchronous 
        Speed: 1067 MHz 
        Manufacturer: 0x80CE 
        Serial Number: 0x875802AD 
        Asset Tag: Unknown 
        Part Number: M393B5673FH0-CH9   
 

注意,如果信息包含Error Information Handle: Not Provided,Total Width: 72 bits, Data Width: 64 bits则表明ecc是启动的。


发布评论
IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

Linux递归删除文件命令详解
你是第一个吃螃蟹的人
发表评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。