Linux释放caching的内存
root@server ~]# free -mtotal used free shared buffers cachedMem: 249 163 86 0 10 94-/+ buffers/cache: 58 191Swap: 511 0 511其中:total 内存总数used 已经使用的内存数free 空闲的内存数shared 多个进程共享的内存总额buffers Buffer Cache和cached Page Cache 磁盘缓存的大小-buffers/cache 的内存数:used - buffers - cached+buffers/cache 的内存数:free + buffers + cached可用的memory=free memory+buffers+cached 通过修改/proc/sys/vm/drop_caches的值即可释放cache的内存[root@server test]# echo 3 > /proc/sys/vm/drop_caches[root@server test]# cat /proc/sys/vm/drop_caches3/proc/sys/vm/drop_caches (since Linux 2.6.16)Writing to this file causes the kernel to drop clean caches,dentries and inodes from memory, causing that memory to become free.
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.
Because this is a non-destructive operation and dirty objects
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.
Because this is a non-destructive operation and dirty objects
posted on 2012-06-01 11:02 fergus.y.m 阅读(175) 评论(0) 收藏 举报
浙公网安备 33010602011771号