手动释放内存 1.sync将内存中的缓存写入磁盘 2. to free pagecache, use echo 1 > /proc/sys/vm/drop_caches; to free dentries and inodes, use echo 2 > /proc/sys/vm/drop_caches; to free pagecache, dentries and inodes, use echo 3 >/proc/sys/vm/drop_caches.…
有时候,像mongo这种,对内存只吃不吐的,我们要手动释放一下. 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_cachesTo free d…
先使用sync命令以确保文件系统的完整性,sync 命令运行 sync 子例程,将所有未写的系统缓冲区写到磁盘中,包含已修改的 i-node.已延迟的块 I/O 和读写映射文件. 再执行下面任意一条命令: Writing to this file causes the kernel to drop clean caches,dentries and inodes from memory, causing that memory to becomefree. To > /proc/sys/vm/d…