How to clear directory/inode cache on MacOSX

2019-04-28 01:33发布

问题:

How to clear file system cache (e.g. directory cache and inode cache) on a Mac OSX? I would like to do some performance analysis on a cold MacOSX machine. I am wondering that is there any approach like echo 3 > /proc/sys/vm/drop_caches on a Linux box?

回答1:

is purge(8) any use to you?

Purge can be used to approximate initial boot conditions with a cold disk buffer cache for performance analysis. It does not affect anonymous memory that has been allocated through malloc, vm_allocate, etc.