What is /proc/sys/vm/drop_caches?
🔍 What is /proc/sys/vm/drop_caches?
This is a virtual kernel interface that lets you manually free up memory used by:
-
The page cache (file data)
-
Dentries (directory entries)
-
Inodes (metadata for files)
It’s useful when:
-
You want to test performance without file cache interference
-
You need to free up RAM quickly in a controlled environment
-
You're benchmarking or tuning systems and want a clean cache state
⚠️ Why cat drop_caches gives "Permission denied"
Even as root, you can't read this file.
Here's why:
-
It’s write-only.
-
There’s no read (
r) permission — by design. -
The kernel doesn't expose a value here; it only accepts commands.
✅ How to properly clear caches
Before you drop caches, it’s important to sync your file system to avoid data loss:
Then, choose the appropriate option:
✅ Recommended safe combo: