linux下查看内存条数及每根内存大小的实现方法(推荐)

(编辑:jimmy 日期: 2024/11/12 浏览:2)

在linux系统中,查看内存条个数,及每根内存的大小,可以使用dmidecode命令。

如下:

#dmidecode | grep -A16 "Memory Device$"

输出结果:

Memory Device #存储设备
Array Handle: 0x1000 #阵列处理
Error Information Handle: Not Provided #错误信息的处理:不提供 
Total Width: 72 bits #总宽度: 72位
Data Width: 64 bits #数据宽度: 64位 
Size: 1024 MB #大小
Form Factor: 
Set: 1
Locator: DIMM1 
Bank Locator: Not Specified
Type: 
Type Detail: Synchronous #输入详细信息:同步 
Speed: 667 MHz (1.5 ns) #速度: 667兆赫( 1.5纳秒)
Manufacturer: 80AD7FB380AD #制造商
Serial Number: 42600700 #序号
Asset Tag: 010910
Part Number: HYMP112F72CP8D3-Y5
--
//by www.jb51.net
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: 
Set: 1
Locator: DIMM2 
Bank Locator: Not Specified
Type: 
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: 80AD7FB380AD
Serial Number: 42600213
Asset Tag: 010910
Part Number: HYMP112F72CP8D3-Y5
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: 
Set: 2
Locator: DIMM3 
Bank Locator: Not Specified
Type: 
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: 855185518551
Serial Number: 0503BE1A
Asset Tag: 4C0838
Part Number: 72T128401EFA3SC2 
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: 
Set: 2
Locator: DIMM4 
Bank Locator: Not Specified
Type: 
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: 855185518551
Serial Number: 0503BF1F
Asset Tag: 4C0838
Part Number: 72T128401EFA3SC2 
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed
Form Factor: 
Set: 3
Locator: DIMM5 
Bank Locator: Not Specified
Type: 
Type Detail: Synchronous
Speed: Unknown
Manufacturer: 
Serial Number: 
Asset Tag: 
Part Number: 
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed
Form Factor: 
Set: 3
Locator: DIMM6 
Bank Locator: Not Specified
Type: 
Type Detail: Synchronous
Speed: Unknown
Manufacturer: 
Serial Number: 
Asset Tag: 
Part Number: 
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed
Form Factor: 
Set: 4
Locator: DIMM7 
Bank Locator: Not Specified
Type: 
Type Detail: Synchronous
Speed: Unknown
Manufacturer: 
Serial Number: 
Asset Tag: 
Part Number: 
--//by www.jb51.net
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed
Form Factor: 
Set: 4
Locator: DIMM8 
Bank Locator: Not Specified
Type: 
Type Detail: Synchronous
Speed: Unknown
Manufacturer: 
Serial Number: 
Asset Tag: 
Part Number:

然后,用free命令查看当前内存的使用情况:

# free -m 
total used free shared buffers cached
Mem: 4054 2963 1090 0 144 1272
-/+ buffers/cache: 1547 2506
Swap: 4094 0 4094

以上就是小编为大家带来的linux下查看内存条数及每根内存大小的实现方法(推荐)全部内容了,希望大家多多支持~

一句话新闻
一文看懂荣耀MagicBook Pro 16
荣耀猎人回归!七大亮点看懂不只是轻薄本,更是游戏本的MagicBook Pro 16.
人们对于笔记本电脑有一个固有印象:要么轻薄但性能一般,要么性能强劲但笨重臃肿。然而,今年荣耀新推出的MagicBook Pro 16刷新了人们的认知——发布会上,荣耀宣布猎人游戏本正式回归,称其继承了荣耀 HUNTER 基因,并自信地为其打出“轻薄本,更是游戏本”的口号。
众所周知,寻求轻薄本的用户普遍更看重便携性、外观造型、静谧性和打字办公等用机体验,而寻求游戏本的用户则普遍更看重硬件配置、性能释放等硬核指标。把两个看似难以相干的产品融合到一起,我们不禁对它产生了强烈的好奇:作为代表荣耀猎人游戏本的跨界新物种,它究竟做了哪些平衡以兼顾不同人群的各类需求呢?