欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

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

程序员文章站 2022-11-13 20:01:27
在linux系统中,查看内存条个数,及每根内存的大小,可以使用dmidecode命令。 如下: #dmidecode | grep -a16 "memory d...

在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下查看内存条数及每根内存大小的实现方法(推荐)全部内容了,希望大家多多支持~