MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / drop_page_cache

Method drop_page_cache

src/executor/memory/tunables.rs:58–64  ·  view source on GitHub ↗

Drops the page cache. Nothing to restore: the node is a write-only trigger and the kernel refills the cache on demand.

()

Source from the content-addressed store, hash-verified

56 /// Drops the page cache. Nothing to restore: the node is a write-only
57 /// trigger and the kernel refills the cache on demand.
58 fn drop_page_cache() {
59 // drop_caches only reclaims clean objects; flush dirty buffers first.
60 nix::unistd::sync();
61 if let Err(error) = write_root_file("/proc/sys/vm/drop_caches", "3") {
62 warn!("Failed to drop the page cache: {error}");
63 }
64 }
65
66 /// Sets the THP default mode, returning the prior mode when it changed.
67 fn set_thp_enabled(value: &str) -> Vec<(String, String)> {

Callers

nothing calls this directly

Calls 1

write_root_fileFunction · 0.85

Tested by

no test coverage detected