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定时清理

  • 相关阅读:
    免费的mysql客户端管理工具
    vue配置反向代理
    composer下载地址
    mysql多个字段模糊查询是否包含某个词
    Laravel 7 中文文档
    datatable显示文字改为中文
    MongoDB
    node 与 Ajax 的等待响应
    关于 <!DOCTYPE html> 对移动端和PC端的影响
    Vue中 scoped属性
  • 原文地址:https://www.cnblogs.com/whaleX/p/13978818.html
Copyright © 2011-2022 走看看