zoukankan      html  css  js  c++  java
  • 【随手记录】释放pagecache

     

    在执行后面三条命令之前一定要先执行sync命令
    (描述:sync 命令运行 sync 子例程,如果必须停止系统,则运行sync 命令以确保文件系统的完整性
    sync 命令将所有未写的系统缓冲区写到磁盘中,包含已修改的 i-Node、已延迟的块 I/O 和读写映射文件)

    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.
    这是一种无损操作,只会释放完全未使用的东西。 脏对象将继续使用,直到将其写到磁盘上并且无法释放。 如果先运行“同步”以将它们刷新到磁盘,则这些删除操作将倾向于释放更多的内存。

    如果有需要可以写个脚本,然后加入到crontab定时清理

  • 相关阅读:
    瀑布流布局(等宽不等高jQuery)
    多组图自动无限循环(swiper轮播)
    $.ajax的标准写法
    走马灯特效
    如何使用js改变HTML中title里面固定的文字
    test
    单例设计模式
    线程的五种状态(线程的生命周期)
    Net基础班第十三天
    装箱、拆箱
  • 原文地址:https://www.cnblogs.com/whaleX/p/13978818.html
Copyright © 2011-2022 走看看