caching - How to drop memory cache periodically in Linux? -


working on system measurement project , requires me drop cache periodically accurate number (since having cache there alter results). can manually drop cache using:

echo 3 > /proc/sys/vm/drop_caches

however, want automatically drop every microsecond. command should use?

you create own command that, i.e. write program that. example, like:

while (1) {     if ((fp = fopen("/proc/sys/vm/drop_caches", "r")) == null) {         /* error handler */     }     fprintf(fp, "3\n");     fclose(fp);      nanosleep(...); /* see nanosleep(2) */ } 

in program, , made daemon.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -