To clear the RAM cache in Linux, use this simple command as root.
Clear PageCache, dentries and inodes.
[email protected]:~# sync; echo 3 > /proc/sys/vm/drop_caches
This is a very useful command for clearing the RAM cache if a process has been eating away at your memory and you need to clear it quickly. This command must be run as root and not with sudo. Use
sudo su - then run this command properly. This does work though, and will not interrupt your Linux operations.