Skip to contentSkip to conversation

how to empty buffers/cache?

DISCUSSION Soeren Sonnenburg 2 participants 3 messages May 9, 2008 – May 13, 2008

lore
Share & tools
lore
#0 lore raw

Dear all,

I am trying to perform some benchmarks that involve reading the same big file a couple of times from disk. However I would want to make sure that the file is not buffered/cached by the kernel when I read the file a second/third/etc time.

Is there a way (except rebooting/unmounting the disk) to clear the buffers?

Thanks,
Soeren

#1 lore raw
Quoted 9 lines · El Fri, 09 May 2008 21:49:47 +0000 Soeren Sonnenburg <[email protected]> escribió:

Dear all,

I am trying to perform some benchmarks that involve reading the same big file a couple of times from disk. However I would want to make sure that the file is not buffered/cached by the kernel when I read the file a second/third/etc time.

Is there a way (except rebooting/unmounting the disk) to clear the buffers?

echo 3 > /proc/sys/vm/drop_caches IIRC

Quoted 8 lines

Thanks,
Soeren
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 10 lines · Alejandro Riveira Fernández
Quoted 7 lines · El Fri, 09 May 2008 21:49:47 +0000 Soeren Sonnenburg <[email protected]> escribió:

Dear all,

I am trying to perform some benchmarks that involve reading the same big file a couple of times from disk. However I would want to make sure that the file is not buffered/cached by the kernel when I read the file a second/third/etc time.

Quoted 4 lines
Quoted 2 lines

Is there a way (except rebooting/unmounting the disk) to clear the buffers?

echo 3 > /proc/sys/vm/drop_caches IIRC

thank you both very much ( echo 3 > ... is what I was looking for)

Soeren