vmtouch

# ./vmtouch 
./vmtouch: no files or directories specified

vmtouch v1.3.1 - the Virtual Memory Toucher by Doug Hoyte
Portable file system cache diagnostics and control

Usage: vmtouch [OPTIONS] ... FILES OR DIRECTORIES ...

Options:
  -t touch pages into memory
  -e evict pages from memory
  -l lock pages in physical memory with mlock(2)
  -L lock pages in physical memory with mlockall(2)
  -d daemon mode
  -m <size> max file size to touch
  -p <range> use the specified portion instead of the entire file
  -f follow symbolic links
  -F don't crawl different filesystems
  -h also count hardlinked copies
  -i <pattern> ignores files and directories that match this pattern
  -I <pattern> only process files that match this pattern
  -b <list file> get files or directories from the list file
  -0 in batch mode (-b) separate paths with NUL byte instead of newline
  -w wait until all pages are locked (only useful together with -d)
  -P <pidfile> write a pidfile (only useful together with -l or -L)
  -o <type> output in machine friendly format.  'kv' for key=value pairs.
  -v verbose
  -q quiet
# ./vmtouch test.bin
           Files: 1
     Directories: 0
  Resident Pages: 109159/109159  426M/426M  100%
         Elapsed: 0.069863 seconds
# echo 3 > /proc/sys/vm/drop_caches
# ./vmtouch test.bin 
           Files: 1
     Directories: 0
  Resident Pages: 0/109159  0/426M  0%
         Elapsed: 0.01347 seconds

常见命令: 

加入缓存

vmtouch -vt 文件名

查询

vmtouch 文件名

Reference: 

Linux查看cache工具_linux 如何查看cache使用情况-CSDN博客

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值