当前位置: 技术问答>linux和unix
linux top命令下内存资源的讨论,高手请进。。。
来源: 互联网 发布时间:2017-02-26
本文导语: 问题描述如下:这是我昨天到今天用top命令跟踪的系统内存使用情况,意外发现used不断在增加,free在减少,同时buffers每个几秒就会增加8k或者16k,从未见过buffer有下降的情况,这是不是说明系统某个进程出现内存泄...
问题描述如下:这是我昨天到今天用top命令跟踪的系统内存使用情况,意外发现used不断在增加,free在减少,同时buffers每个几秒就会增加8k或者16k,从未见过buffer有下降的情况,这是不是说明系统某个进程出现内存泄露呢?
6.6
top - 20:10:37 up 5 min, 1 user, load average: 0.03, 0.20, 0.11
Tasks: 116 total, 1 running, 115 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1026504k total, 260016k used, 766488k free, 15244k buffersSwap: 2048248k total, 0k used, 2048248k free, 163072k cached
6.6
top - 22:47:00 up 2:41, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 116 total, 1 running, 115 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 1026504k total, 329048k used, 697456k free, 20596k buffersSwap: 2048248k total, 0k used, 2048248k free, 225832k cached
6.7
top - 09:40:18 up 13:34, 1 user, load average: 0.00, 0.00, 0.00
Mem: 1026504k total, 441240k used, 585264k free, 105564k buffersSwap: 2048248k total, 0k used, 2048248k free, 238500k cached
6.6
top - 20:10:37 up 5 min, 1 user, load average: 0.03, 0.20, 0.11
Tasks: 116 total, 1 running, 115 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1026504k total, 260016k used, 766488k free, 15244k buffersSwap: 2048248k total, 0k used, 2048248k free, 163072k cached
6.6
top - 22:47:00 up 2:41, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 116 total, 1 running, 115 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 1026504k total, 329048k used, 697456k free, 20596k buffersSwap: 2048248k total, 0k used, 2048248k free, 225832k cached
6.7
top - 09:40:18 up 13:34, 1 user, load average: 0.00, 0.00, 0.00
Mem: 1026504k total, 441240k used, 585264k free, 105564k buffersSwap: 2048248k total, 0k used, 2048248k free, 238500k cached
|
是正常的,为了提高IO性能,系统会自动进行buffer与cache,584892k free是针对OS而言的,对于应用程序而言,空闲内存应该是free+buffers+cached,应为这些都是可以快速回收的