红联Linux门户
Linux帮助

为什么我的RHEL已用的内存那个你那么多阿

发布时间:2009-06-03 15:31:38来源:红联作者:hjyyc9999
最近新装了redhat linux,总内存4G,基本上安装光盘默认的安装步骤安装的,但装好之后感觉很慢,特别是上网,有点象幻灯片似的!
机子配置为:双核2.5G,4G内存
电脑空转的CPU和MEM的使用情况为:

top - 23:10:04 up 4:27, 2 users, load average: 0.21, 0.12, 0.40
Tasks: 154 total, 2 running, 151 sleeping, 0 stopped, 1 zombie
Cpu(s): 2.5%us, 0.2%sy, 0.0%ni, 97.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 3704832k total, 3035344k used, 669488k free, 72148k buffers
Swap: 4192956k total, 0k used, 4192956k free, 2335844k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

3497 root 15 0 232m 17m 7628 S 1.7 0.5 5:56.47 Xorg
13587 hj 15 0 306m 17m 9.8m S 0.3 0.5 0:00.17 gnome-terminal
1 root 15 0 10344 676 564 S 0.0 0.0 0:02.15 init
2 root RT -5 0 0 0 S 0.0 0.0 0:03.69 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:36.25 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/1
6 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/1
7 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
8 root 10 -5 0 0 0 S 0.0 0.0 3:48.17 events/0
9 root 10 -5 0 0 0 S 0.0 0.0 0:01.27 events/1
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
11 root 10 -5 0 0 0 S 0.0 0.0 0:00.46 kthread
13 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 xenwatch
14 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 xenbus
17 root 10 -5 0 0 0 S 0.0 0.0 0:05.67 kblockd/0
18 root 10 -5 0 0 0 S 0.0 0.0 0:00.13 kblockd/1

发现内存使用3个多G,机子并没开其他程序,不知这是为什么,为什么机子这么慢呢?
多谢高手!
文章评论

共有 6 条评论

  1. deepwhite 于 2009-06-03 18:30:46发表:

    哪有5.4?5.3才刚刚发布……

    减少不必要的系统服务试试看,应该会快一些。

  2. hjyyc9999 于 2009-06-03 16:04:06发表:

    我的最新版的RHEL5.4,应该不至于不支持把!

  3. jagub 于 2009-06-03 15:59:29发表:

    内存被buffer 和 cache了

  4. hjyyc9999 于 2009-06-03 15:43:25发表:

    查了一下空闲的内存的实际计算方法为:
    1. $ free -m

    total used free shared buffers cached
    Mem: 1002 769 232 0 62 421
    -/+ buffers/cache: 286 715
    Swap: 1153 0 1153

    第一部分Mem行:
    total 内存总数: 1002M
    used 已经使用的内存数: 769M
    free 空闲的内存数: 232M
    shared 当前已经废弃不用,总是0
    buffers Buffer 缓存内存数: 62M
    cached Page 缓存内存数:421M

    关系:total(1002M) = used(769M) + free(232M)

    第二部分(-/+ buffers/cache):
    (-buffers/cache) used内存数:286M (指的第一部分Mem行中的used - buffers - cached)
    (+buffers/cache) free内存数: 715M (指的第一部分Mem行中的free + buffers + cached)

    可见-buffers/cache反映的是被程序实实在在吃掉的内存,而+buffers/cache反映的是可以挪用的内存总数。

    对操作系统来讲是Mem的参数.buffers/cached 都是属于被使用,所以它认为free只有232.
    对应用程序来讲是(-/+ buffers/cach).buffers/cached 是等同可用的,因为buffer/cached是为了提高程序执行的性能,当程序使用内存时,buffer/cached会很快地被使用。


    不过这就更想不通拉,为什么浏览网页会这么慢呢!

  5. osiwenc 于 2009-06-03 15:42:49发表:

    是不是以前的那些版本不支持大内存啊

  6. osiwenc 于 2009-06-03 15:42:32发表:

    搞什么呀,4G按理说像坐飞机那样快了