robbat2: (Default)
robbat2 ([personal profile] robbat2) wrote2006-06-10 04:04 pm

[Gentoo] clearing pagecache/dentries/inodes without rebooting

Stumbled over this wonderful commit to the tree earlier today.

In short, it allows you to dump pagecache/dentries/inodes for profiling stuff in the system. It's present in kernels newer than 2.6.16.

Cut from the docs:
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 not freeable, the
user should run `sync' first.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org