Skip to content

Commit

Permalink
cache cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
shohan-pherones committed Apr 7, 2023
1 parent f960211 commit d0abdfb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions proc/sys/vm/drop_caches.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use std::fs::File;
use std::io::{Write, BufWriter};

fn main() {
// Open the `drop_caches` file
let file = File::open("/proc/sys/vm/drop_caches").expect("Failed to open file");

// Write the value 3 to the file to clear the cache
let mut writer = BufWriter::new(file);
writer.write_all(b"3").expect("Failed to write to file");
}

0 comments on commit d0abdfb

Please sign in to comment.