zoukankan      html  css  js  c++  java
  • 清除linux缓存命令

    命令

    #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.

  • 相关阅读:
    221. 最大正方形
    9. 回文数
    2. 两数相加
    1. 两数之和
    HDU 1864 最大报销额
    47 java包打成本地maven
    46 数组中的元素进行位置交换
    5 docker安装kibana
    45 vue图片放大预览
    4 docker中安装es
  • 原文地址:https://www.cnblogs.com/mowei/p/6781649.html
Copyright © 2011-2022 走看看