查看当前内存情况meminfo


在软件工程学中,内存分配器形成了很多有趣的案例供学习。一直在订正和改进。
内存分配器提供了标准的C语句API,和一些辅助使用例程。


1)查看当前内存是否正常

cat /proc/meminfo
将会显示内存的总容量,
cat /proc/meminfo
MemTotal:         879976 kB
MemFree:           48260 kB
Buffers:           13800 kB
Cached:           688284 kB
SwapCached:           76 kB
Active:           135684 kB
Inactive:         603768 kB
Active(anon):       4764 kB
Inactive(anon):    36016 kB
Active(file):     130920 kB
Inactive(file):   567752 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4194300 kB
SwapFree:        4194204 kB
Dirty:              4028 kB
Writeback:             0 kB
AnonPages:         37344 kB
Mapped:             8592 kB
Shmem:              3368 kB
Slab:              57588 kB
SReclaimable:      28688 kB
SUnreclaim:        28900 kB
KernelStack:        3016 kB
PageTables:         3036 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     4634288 kB
Committed_AS:     352896 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      345616 kB
VmallocChunk:   34359388152 kB
HardwareCorrupted:     0 kB
AnonHugePages:      8192 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       55872 kB
DirectMap2M:      983040 kB

要查���的 RAM �格, ex: DDR2、DDR3 .. 等, 可以用下述指令   lshw 无效

dmidecode -t 17
# dmidecode 2.9
SMBIOS 2.5 present.

Handle 0x0029, DMI type 17, 27 bytes
Memory Device
 Array Handle: 0x0027
 Error Information Handle: Not Provided
 Total Width: 64 bits
 Data Width: 64 bits
 Size: 2048 MB
 Form Factor: DIMM
 Set: None
 Locator: DIMM A1
 Bank Locator: BANK0
 Type: Other
 Type Detail: Synchronous
 Speed: 800 MHz (1.2 ns)
 Manufacturer: Manufacturer0
 Serial Number: SerNum0
 Asset Tag: AssetTagNum0
 Part Number: PartNum0

Handle 0x002B, DMI type 17, 27 bytes
Memory Device
 Array Handle: 0x0027
 Error Information Handle: Not Provided
 Total Width: Unknown
 Data Width: Unknown
 Size: No Module Installed
 Form Factor: DIMM
 Set: None
 Locator: DIMM B1
 Bank Locator: BANK1
 Type: Unknown
 Type Detail: Unknown
 Speed: Unknown
 Manufacturer: Manufacturer1
 Serial Number: SerNum1
 Asset Tag: AssetTagNum1
 Part Number: PartNum1
free -g 或者 -m 以KB或者GB显示


Mem:   1888548k total,  1829968k used,    58580k free,    20228k buffers
top命令显示的空闲内存会 让你忐忑不安,但是当你了解大部分的内存都是应用
在缓存文件,加快访问磁盘数据的速度,你就会享受Linux带来的高速响应。


dmidecode -t 16
# dmidecode 2.9
SMBIOS 2.5 present.

Handle 0x0027, DMI type 16, 15 bytes
Physical Memory Array
 Location: System Board Or Motherboard
 Use: System Memory
 Error Correction Type: None
 Maximum Capacity: 8 GB
 Error Information Handle: Not Provided
 Number Of Devices: 2

 a down to earth person
一个脚踏实地的人

I am a Linux evangelist who believes in Hard work

你可能感兴趣的:(File,软件,工程学,分配器)