Linux pagecache????????
?????sxhlinux ???????[ 2017/2/8 11:20:26 ] ?????????????? Linux
??????黷?? CentOS Linux release 7.3.1611 (Core) 3.10.0-514.6.1.el7.x86_64
??????????????
????linux??????????free???????????????????free??????????/proc/meminfo????ж????????????????м?????????????????free?????????????????ε???塣
????total??????????С???????????mem??????????swap??
????used??????????棨total - free - buffers - cache??
????free??δ???????
????shared????????????tmpfs???????????????????
????buffers?????????????????
????cache??page cache??slab????????????
????buff/cache??buffers + cache
????available?????????swap?????????ж???????????????μ??????????free??buff/cache????е???????????????????????????free???????????????Щslab??cache??????????????????page cache??mem slab?????????
??????????page cache??????д????????????????????????????????浽????С????????????????????I/O??????????????????????????棬?????????????????????????
??????????????
????linux??????????Щд??????????????????????????Щ?????????????cache??????????????棬??????Щ?????cache????????????????????????????Щcache flush???????С??????????δ????????Щcache flush???????е????????????????浼?3???swap??????????????????????????????
????/proc?????????????????????????????????д?????????kernel????????????????Ρ???????????????/proc?е????????????kernel??????????????????????????y?? /proc/sys/vm/drop_caches ??????????????????cache???????????????????????????????1??2??3?????????????
????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_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
????- As this is a non-destructive operation?? and dirty objects are notfreeable?? the user should run "sync" first in order to make sure allcached objects are freed.
????- This tunable was added in 2.6.16.
?????????????????????????????????????sync????page cache??μ??????У???????????drop_caches?????л????????
???????????д???????????????????????????????????????У???????????????????棬?????????????linux ????OOM???μ????????????????????????????С???????д????????????????close??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11