github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/bench/microbenchmarks/nstlvl/drop_caches_linux.go (about) 1 // Package nstlvl is intended to measure impact (or lack of thereof) of POSIX directory nesting on random read performance. 2 /* 3 * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved. 4 */ 5 package nstlvl 6 7 import ( 8 "os/exec" 9 10 "github.com/NVIDIA/aistore/cmn/cos" 11 ) 12 13 func DropCaches() { 14 cmd := exec.Command("echo", "3", ">", "/proc/sys/vm/drop_caches") // https://www.kernel.org/doc/Documentation/sysctl/vm.txt 15 _, err := cmd.Output() 16 cos.AssertNoErr(err) 17 }