Does below command improved performance of the machine:
sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
I know this is for freeing RAM. Please guide
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
No, it just dumps a load of stuff (slab objects and pagecache) from the system cache.
If your system is out of memory (and I mean: deep into swap usage, nothing free, hard disk churning) then yes, this might help... But not as much as:
So while it may work for a few seconds, if you have something rampaging all over your RAM, you'd do better just to close it, or buy it more RAM with which to rampage over. Freeing up inode and page cache isn't going to help you for long.
No, see How do I clean or disable the memory cache? for an indepth answer.
Cache is there to be used and to speed things up. So Linux makes full use of caching. If you do this it will takes seconds for the cache to be filled up again.
Adding hardware to your system would be more efficient (depending on what triggered your question it might be memory or a better hard disk).