释放内存前

# free -m
             total       used       free     shared    buffers     cached
Mem:          7831       7704        127          0        256       6813
-/+ buffers/cache:        634       7197
Swap:         7999          0       7999

sync && echo 1 > /proc/sys/vm/drop_caches
sync && echo 2 > /proc/sys/vm/drop_caches
sync && echo 3 > /proc/sys/vm/drop_caches

Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free.

To free pagecache:

* echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

* echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

* echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation, and dirty objects are notfreeable, the user should run "sync" first in order to make sure allcached objects are freed.

This tunable was added in 2.6.16.

释放内存后

# free -m
             total       used       free     shared    buffers     cached
Mem:          7831        365       7466          0          0         18
-/+ buffers/cache:        346       7485
Swap:         7999          0       7999

转载于:https://blog.51cto.com/lihongweibj/1616892

linux 释放cache 内存相关推荐

  1. linux怎么释放cached中内存,Linux 释放cached内存

    使用free -m 查看系统使用的内存情况: # free -m total      used      free      shared      buffers -/+ buffers/cach ...

  2. Linux中Cache内存占用过高解决办法

    在Linux系统中,我们经常用free命令来查看系统内存的使用状态.在一个RHEL6的系统上,free命令的显示内容大概是这样一个状态: 这里的默认显示单位是kb,我的服务器是128G内存,所以数字显 ...

  3. Linux buffer/cache 内存占用过高的原因以及解决办法

    表现现象 在Linux系统中,我们经常用free命令来查看系统内存的使用状态.在一个 CoreOS 的系统上,free命令的显示内容大概是这样一个状态: core@localhost ~ $ free ...

  4. linux缓冲区内容占用较多什么原因,Linux中Cache内存占用太高解决办法

    在Linux系统中,咱们常常用free命令来查看系统内存的使用状态.在一个RHEL6的系统上,free命令的显示内容大概是这样一个状态:html 这里的默认显示单位是kb,个人服务器是128G内存,因 ...

  5. linux释放cache

    Cache:存放从硬盘上读出的数据,即缓存. 释放cache: echo 3 > /proc/sys/vm/drop_caches

  6. node linux cache补释放,linux下释放cache内存

    细心的朋友会注意到,当你在linux下频繁存取文件后,物理内存会很快被用光,当程序结束后,内存不会被正常释放,而是一直作为caching.这个问题,貌似有不少人在问,不过都没有看到有什么很好解决的办法 ...

  7. Linux 释放cpugpu内存、显存和硬盘

    free -m free -mtotal used free shared buff/cache available Mem: 128831 15666 23617 406 89547 111448 ...

  8. 手工释放cache内存

    服务器buff/cache占用过高,手工释放 1. 查看内存使用情况 free -h 2. 执行sync命令 内存缓冲块数据强制写入磁盘,以防重新启动,关机,或者是不正常断电的情况下,数据还没来得及存 ...

  9. linux怎么修改内存缓存,Linux内存、缓存、Swap等修改

    1. Linux 修改系统内存大小:修改启动文件,增加mem=300M,如下: vi /boot/grub/grub.conf ...... title CentOS (2.6.18-194.3.1. ...

最新文章

  1. 将php-fpm添加至service服务
  2. bilibili源码_selenium+phantomjs爬取bilibili
  3. spring原始注解开发-01
  4. 龙岩学院计算机专业宿舍,龙岩学院的各个学院位置有谁能说下
  5. line-height的一点见识
  6. 隔行变色java代码_jquery入门—选择器实现隔行变色实例代码
  7. 畅通工程(HDU-1232)
  8. java day46【AJAX 、JSON】
  9. 在win7 64位上安装VS2015的问题汇总
  10. mac tree命令
  11. usc2_今天发布:与USC合作的新游戏设计课程
  12. maxon电机/步科电机 CANOpen协议指令速度模式
  13. 什么软件可以让头发变黑_吃什么可以让头发变黑?
  14. 码率、帧率和I B P帧
  15. eclipse 64位 免安装_超详细:64位Linux下安装PS模拟器ePSxe
  16. 郭长波连任OpenStack基金会独立董事 继续推动中国力量话语权
  17. 类似于wps的linux软件,出了Office、WPS还有哪些好用的办公软件?
  18. 深入浅出理解类和对象
  19. 利用Hackrf One进行GPS定位欺骗制作超级跑马机
  20. DC-DC电源芯片(VIPER22A)的BUCK电路使用说明

热门文章

  1. Oracle中过程/函数返回结果集
  2. ORACLE中的两个概念:user和schema的区别和联系
  3. 【最新】docker 安装elasticsearch + kibana步骤【第二篇_kibana】
  4. Set的常用实现类HashSet和TreeSet
  5. 深入解析QML引擎, 第4部分: 自定义解析器
  6. 经营为什么需要哲学(学习总结)
  7. gmp会屏蔽掉base里的几个函数
  8. 软件工程概论_课堂测试
  9. 浏览器常见bug及解决办法
  10. Linux(9.21-9.27)学习笔记