Juozas's Dump

A growing collection of anime, photos and any other kind of weird content.
[Tumblr|​X/Twitter|​Pillowfort|​Loforo|​Mastodon] [Random post]

 tags  journal  gallery  RSS

26.6.2023 22:45:40

Clearing i/o cache on Linux

Running

sync; echo 3 > /proc/sys/vm/drop_caches 

under root or

sudo bash -c 'sync; echo 3 > /proc/sys/vm/drop_caches'

when using sudo helps to avoid some i/o caching issues when benchmarking file system operations such as duplicate finding. Meaning of values (from kernel documentation, https://www.kernel.org/doc/Documentation/sysctl/vm.txt):

To free pagecache:

echo 1 > /proc/sys/vm/drop_caches

To free reclaimable slab objects (includes dentries and inodes):

echo 2 > /proc/sys/vm/drop_caches

To free slab objects and pagecache:

echo 3 > /proc/sys/vm/drop_caches


reposted by linux
login