LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2114|回复: 13

Linux下如何清理内存,急!!!

[复制链接]
发表于 2006-4-30 10:00:21 | 显示全部楼层 |阅读模式
操作系统:SLES 9 U2
我在该操作系统上装了oracle 9.2.0.7
由于系统内存占用太高,我把oralce停了下来,可是内存并没有降下来,由于本机是做服务器来用,其中有一个文件系统是以NFS格式mount到别的机器中的,不好重起,请问有没有什么办法可以清理一下内存呢?  谢谢!
发表于 2006-4-30 10:12:21 | 显示全部楼层
一般来说,LINUX是不需要整理内存的。它会自己调配好。不用太担心的
回复 支持 反对

使用道具 举报

发表于 2006-4-30 10:16:05 | 显示全部楼层
看看是不是都cache了?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-30 10:21:37 | 显示全部楼层
Post by Edouard
一般来说,LINUX是不需要整理内存的。它会自己调配好。不用太担心的
是的啊, 可是我的这台机器放在这好久了,还是那个样子,内存就是不释放。不知道到底是个什么原因?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-30 10:23:36 | 显示全部楼层
Post by TechLive
看看是不是都cache了?
不是被cache了,就是在被使用,used.
回复 支持 反对

使用道具 举报

发表于 2006-4-30 10:24:41 | 显示全部楼层
free 结果贴上来。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-30 10:29:43 | 显示全部楼层

  1. [root@crmsvrp3 ~]# free
  2.              total       used       free     shared    buffers     cached
  3. Mem:       8168096    4466612    3701484          0      95124      82228
  4. -/+ buffers/cache:    4289260    3878836
  5. Swap:     20479992      77036   20402956
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-30 10:32:58 | 显示全部楼层

  1. [root@crmsvrp3 ~]# ipcs

  2. ------ Shared Memory Segments --------
  3. key        shmid      owner      perms      bytes      nattch     status      
  4. 0xf902a00d 0          root      600        189        1                       
  5. 0x0000bbbd 32769      root      666        126328     2                       
  6. 0x010291da 65538      root      600        512000     2                       

  7. ------ Semaphore Arrays --------
  8. key        semid      owner      perms      nsems     
  9. 0x73000018 0          root      600        1         
  10. 0x0000033d 32769      root      644        1         
  11. 0x7105800e 65538      root      666        1         
  12. 0x00000000 163843     hpsmh     600        1         
  13. 0x00000000 196612     hpsmh     600        1         
  14. 0x00000000 229381     hpsmh     600        1         
  15. 0x0000752f 262150     cp1adm    777        5         

  16. ------ Message Queues --------
  17. key        msqid      owner      perms      used-bytes   messages   
  18. 0x51000018 0          root       700        0            0           
  19. 0x2302a007 32769      root       600        0            0           
  20. 0x000004d2 98306      root       666        0            0           
复制代码

很显然系统现在的真正的内存使用不到4G啊,free出来的结果怎么会那么多?
请大家帮忙解决,谢谢!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-30 10:58:55 | 显示全部楼层
帖子有点想沉了,顶上来!大家给点意见也行啊!
回复 支持 反对

使用道具 举报

发表于 2006-4-30 11:00:33 | 显示全部楼层
     I have a process that uses a lot of memory while it's running, so the free memory (shown by free or top) goes right down to 60MB out of 8100MB. But when the process exits, the free memory doesn't go back up. Why isn't memory released when the process exits?

The short answer is that you should never worry about the amount of free memory on Linux. The kernel attempts to keep this slightly above zero by keeping the cache as large as possible. This is a feature not a bug.
不知道这能不能说服你不要担心。还一半内存没有用,同时SWAP才交换这么一点,有什么好担心的?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表