I had the same concerns about a heavy-handed cache on an embedded box running 2.6.15 (which does not have the proc file mentioned above). I did some experiments and found that one way to force the cache to clear is to create a ramdisk, fill it up with a huge temp file, and then delete the file. Works perfectly. Of course, what I proved was that Linux will indeed release the cache when absolutely ncessary. BTW changing swappiness to 0 or 100 had absolutely no observable effect on meminfo whatsoever.
in this post it is explained how to do it:
deleting linux cached ram
but be sure to read the complete post for why or why not to clear the caches.
As root:
echo 3 > /proc/sys/vm/drop_caches
I had the same concerns about a heavy-handed cache on an embedded box running 2.6.15 (which does not have the proc file mentioned above). I did some experiments and found that one way to force the cache to clear is to create a ramdisk, fill it up with a huge temp file, and then delete the file. Works perfectly. Of course, what I proved was that Linux will indeed release the cache when absolutely ncessary. BTW changing swappiness to 0 or 100 had absolutely no observable effect on meminfo whatsoever.