命令

#sync
#echo 3 > /proc/sys/vm/drop_caches

查看内存情况:

# more /proc/meminfo

Kernels 2.6.16 and newer provide a mechanism to have the kernel drop the page cache and/or inode and dentry caches on command, which can help free up a lot of memory. Now you can throw away that script that allocated a ton of memory just to get rid of the cache...

To use /proc/sys/vm/drop_caches, just echo a number to it.

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

This is a non-destructive operation and will only free things that are completely unused. Dirty objects will continue to be in use until written out to disk and are not freeable. If you run "sync" first to flush them out to disk, these drop operations will tend to free more memory.

清除linux缓存命令的更多相关文章

  1. linux 通过 mac地址 查询 ip 和 清除arp 缓存

    问题重述: 今天,突然找不到vm 的ip 了,但是可以从网卡状态上看到其 mac 地址,并且确定主机是启动状态,网络状态良好(后来发现因为子网掩码的问题,导致虚拟机和网关之间不通信,从而导致其他网络的 ...

  2. 如何清除DNS缓存,使用cmd命令清理DNS缓存方法

    如何清除DNS缓存,使用cmd命令清理DNS缓存方法 有时候电脑突然上不了网,或者存在某些网站打不开的情况,但别的网站又可以打开,解决办法需要清除DNS缓存,那么如何清除DNS缓存呢,最常用的方法就是 ...

  3. 清除dns缓存

    Linux清除dns缓存命令 /etc/init.d/dnsmasq restart

  4. 012_如何清除DNS缓存

    运维过程中经常会进行切换域名解析等的操作,就需要查看是否更新.但常常DNS设置已经更新了,但是用户那边的DNS还是没有更新. 以下分析几点原因及我的解决方案. 一. <1>本地你的dns缓 ...

  5. linux 缓存手动清除

    linux下怎么清理缓存 free -m 命令可以查看内存使用情况                   sysctl 命令可以临时改变某个系统参数  如:sysctl -w net.ipv4.ip_f ...

  6. Linux清除arp缓存

    arp缓存就是IP地址和MAC地址关系缓存列表.在Windows下 arp -d [$ip] 不指定IP地址时清除所有arp缓存.在Linux下 arp -d $ip 必须指定IP地址才能执行这条命令 ...

  7. Linux下查找包含BOM头的文件和清除BOM头命令 2014-08-16 12:30:50

    Linux下查找包含BOM头的文件和清除BOM头命令 2014-08-16 12:30:50 分类: 系统运维 查找包含BOM头的文件,命令如下: 点击(此处)折叠或打开 grep -r -I -l ...

  8. Ubuntu等Linux系统清除DNS缓存的方法

    buntu等Linux系统清除DNS缓存的方法 直接说方法: 如果系统下有nscd,那么就直接 sudo /etc/init.d/nscd restart 如果没有也没关系,网上接受的方法大都是 su ...

  9. 3.清除dns缓存的意义及命令?

    1.dos命令:ipconfig /flushdns 2.意义: 简单地说就是 www.baidu.com ,www.sina.com 这些就是DNS域名.但是计算机不能直接通过DNS域名访问服务器( ...

随机推荐

  1. javascript基础08

    发现今天居然没有要写,那我就写写之前做的笔记吧. 这是事件的深入: 拖拽逻辑: 第一个: onmousedown : 选择元素 第二个: onmousemove : 移动元素 第三个:onmouseu ...

  2. Android JNI HelloWorld实现

    创建一个JNIDemo的Android工程 在项目下创建一个文件夹jni.(注意必须是jni目录) 在jni目录下创建两个文件:Android.mk 和 first_jni.c(.c文件的名字可以任意 ...

  3. halcon中variation_model_single实例注释.

    * This example shows how to employ the new extensions of HALCON's variation model operators* to perf ...

  4. Oracle Essbase入门系列(四)

    成员存储类型 除了大纲计算,维度成员的另一项重要属性是存储类型,存储类型决定维度成员相关单元格的物理存储方式.在维库中编辑成员的[Data Storage]属性,下拉菜单中可选的5种,再加上Share ...

  5. OpenStack云计算(二)——OpenStack 计算

    http://www.ibm.com/developerworks/cn/cloud/library/cl-openstack-nova-glance/

  6. 利用print2flashsetup.exe文档转swf

    通过使用Print2Flash您可以轻松的将您的文档转换成真正的Adobe Flash格式,最好的保证您的内容将实际可见,与其他格式相比,它并不存在查看工具的安装问题. Print2Flash中有一个 ...

  7. Ecshop 最小起订量如何设置

    第一步,商品表必须有个字段  代表某个商品 最小订购数量->min_number 打开goods表   在最后字段添加一个min_number  tinyint类型 默认值为0  代表没有最小起 ...

  8. “合规性”是考核IT运维的重要指标

    ITSM的绩效考核向来是一个令人头疼的问题,有时就像一团乱麻,既无章可循,又无从下手.其实,只要掌握正确的思想方法,就能拨云见日.“斩乱麻”需“快刀”,“合规性考核”就是斩ITSM绩效考核这团乱麻的快 ...

  9. Intellij idea 乱码问题(英文操作系统)

    英文操作系统导致 Debug 下的变量查看时显示乱码,可通过改变字体解决此问题.

  10. [GraphQL] Use Arguments in a GraphQL Query

    In GraphQL, every field and nested object is able to take in arguments of varying types in order to ...