因为网站开发的需求,需要对单位的服务器内存进行升级。那么在linux中怎么查看内存型号呢?下面跟着我一起来了解一下吧。
linux怎么查看内存型号
机器主板是nVidia Corporation MCP61,系统内存支持双通道内存技术。
配置了4个DDRII DIMM插槽,支持DDRII 800/667/533内存,最大支持8G容量。
为了尝试下双通道内存技术,准备加一条与原来完全一样的内存条。
电脑配置上只写了kingston DDRII512M。
接下来就要用工具dmidecode(DMI table decoder)确定下内存频率了。
dmidecode命令可以全面的显示你系统的信息,包括bios、 cpu 、内存等信息。
例如:
[root@localhost testcase]$ sudo dmidecode --help
Usage: dmidecode [OPTIONS]
Options are:
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)
-h, --help Display this help text and exit
-q, --quiet Less verbose output
-s, --string KEYWORD Only display the value of the given DMI string
-t, --type TYPE Only display the entries of given type
-u, --dump Do not decode the entries
-V, --version Display the version and exit
[root@localhost testcase]$ sudo dmidecode -t memory
# dmidecode 2.7
SM BIOS 2.4 present.
Handle 0x0007, DMI type 5, 24 bytes.
Memory Controller Information
Error Detecting Method: 64-bit ECC
Error Correcting Capabilities:
None
Supported Interleave: One-way Interleave
Current Interleave: One-way Interleave
Maximum Memory Module Size: 2048 MB
Maximum Total Memory Size: 8192 MB
Supported Speeds:
70 ns
60 ns
Supported Memory Types:
DIMM
SDRAM
Memory Module Voltage: 3.3 V
Associated Memory Slots: 4
0x0008
0x0009
0x000A
0x000B
Enabled Error Correcting Capabilities:
None
Handle 0x0008, DMI type 6, 12 bytes.
Memory Module Information
Socket Designation: DIMM0
Bank Connections: 0 1
Current Speed: Unknown
Type: ECC DIMM
Installed Size: 512 MB (Single-bank Connection)
Enabled Size: 512 MB (Single-bank Connection)
Error Status: OK
Handle 0x0009, DMI type 6, 12 bytes.
Memory Module Information
Socket Designation: DIMM1
Bank Connections: None
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK
Handle 0x000A, DMI type 6, 12 bytes.
Memory Module Information
Socket Designation: DIMM2
Bank Connections: None
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK
Handle 0x000B, DMI type 6, 12 bytes.
Memory Module Information
Socket Designation: DIMM3
Bank Connections: None
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK
Handle 0x0010, DMI type 16, 15 bytes.
Physical Memory Arroot
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 8 GB
Error Information Handle: Not Provided
Number Of Devices: 4
Handle 0x0012, DMI type 17, 27 bytes.
Memory Device
Arroot Handle: 0x0010
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 72 bits
Size: 512 MB
Form Factor: DIMM
Set: None
Locator: DIMM0
Bank Locator: BANK0
Type: DDR2
Type Detail: Synchronous
Speed: 533 MHz (1.9 ns)
Manufacturer: Manufacturer0
Serial Number: SerNum0
Asset Tag: AssetTagNum0
Part Number: PartNum0
Handle 0x0014, DMI type 17, 27 bytes.
Memory Device
Arroot Handle: 0x0010
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: 64 bits
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM1
Bank Locator: BANK1
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer1
Serial Number: SerNum1
Asset Tag: AssetTagNum1
Part Number: PartNum1
Handle 0x0016, DMI type 17, 27 bytes.
Memory Device
Arroot Handle: 0x0010
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: 64 bits
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM2
Bank Locator: BANK2
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer2
Serial Number: SerNum2
Asset Tag: AssetTagNum2
Part Number: PartNum2
Handle 0x0018, DMI type 17, 27 bytes.
Memory Device
Arroot Handle: 0x0010
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: 64 bits
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM3
Bank Locator: BANK3
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer3
Serial Number: SerNum3
Asset Tag: AssetTagNum3
Part Number: PartNum3
总结 :
在Memory Controller Information中,可以看到最大的内存大小是8G,支持内存种类为DIMM和SDRAM。有四个Memory Slots。对应接下来的4个Memory Module Information。
DMI type 16 (man dmidecode里面有DMI TYPES specification)的意思是 Physical Memory Arroot。
1. 查看cpu型号cat /proc/cpuinfo | grep "model name" | uniq 2. 查看cpu物理个数cat /proc/cpuinfo | grep "physical id" | uniq | wc -l3.使用PyCPUID模块import pycpuidprint "has SSE2:", pycpuid.HAS_SSE2print "all availabe features:", pycpuid.features()print pycpuid.vendor(1)print "brand string:", pycpuid.brand_string()4. 查看内存信息(显示插槽个数和每个插槽里内存条的大小)dmidecode -t memory | grep Size5. 查看内存条厂家dmidecode -t memory | grep Manufacturer共享内存查看使用ipcs命令,不加如何参数时,会把共享内存、信号量、消息队列的信息都打印出来,如果只想显示共享内存信息,使用如下命令:
[root@localhost ~]# ipcs -m
------ Shared Memory Segments --------
keyshmid owner perms bytes nattch status
0x00000000 1867776root 600393216 2 dest
0x00000000 1900545root 600393216 2 dest
0x00030021 1703938zc666131104 1
0x0003802e 1736707zc666131104 1
0x00030004 1769476zc666131104 1
0x00038002 1802245zc666131104 1
0x00000000 1933318root 600393216 2 dest
0x00000000 1966087root 600393216 2 dest
0x00000000 1998856root 600393216 2 dest
0x00000000 2031625root 600393216 2 dest
0x00000000 2064394root 600393216 2 dest
0x0014350c 2261003cs66633554432 2
0x00000000 2129932root 600393216 2 dest
0x00000000 2162701root 600393216 2 dest
0x00143511 395837454 root 66610485761
其中:
第一列就是共享内存的key;
第二列是共享内存的编号shmid;
第三列就是创建的用户owner;
第四列就是权限perms;
第五列为创建的大小bytes;
第六列为连接到共享内存的进程数nattach;
第七列是共享内存的状态status。其中显示“dest”表示共享内存段已经被删除,但是还有用户在使用它,当该段内存的mode字段设置为SHM_DEST时就会显示“dest”。当用户调用shmctl的IPC_RMID时,内存先查看多少个进程与这个内存关联着,如果关联数为0,就会销毁这段共享内存,否者设置这段内存的mod的mode位为SHM_DEST,如果所有进程都不用则删除这段共享内存。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)