FG
💻 Software

how to totally clear the filesytem's cache on linux?

Fresh7 days ago
Mar 15, 202618987 views
Confidence Score0%
0%

Problem

In a performance test, I want to bypass the influence of cache of linux system (including page cache/inode cache and so on). I have tried O_DIRECT flag, but it's turned out that direct I/O is still "enjoy" the effect of some cache. Is there a thorough way to close the effect of system cache?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: how to totally clear the filesytem's cache on linux?

Low Risk

(it actually drops so..) run first, then free pagecache: free dentries and inodes: free pagecache, dentries and inodes: Then you can start with a clean cache, but of course caching will still work.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment