IPASTE
ID Profile picture Author Share Syntax Rating Source Inserted on Valid until Size
1203 FACEBOOK GOOGLE+ TWITTER LINKEDIN bash 10 1 reviews askubuntu.com 1 year 11 months ago 998 years 23 days 1.11 KB
Views Downloads Status Password Short URL Embedded code
5431 153 VISIBLE NOT PROTECTED
This page was cached. So that, some paste properties could not be updated.

Clean or disable the memory cache ubuntu 12.04

after the above note, if you still feel "cleaning" the cache could help, you can certainly try: it's a one-liner from the terminal:  sync && echo 3 | sudo tee /proc/sys/vm/drop_caches there's no easy way to disable the cache, but you can achieve the same effect by cleaning it as often as every minute, if you want to:  make it a cron-job press alt-f2, type gksudo gedit /etc/crontab, and add this line near the bottom:  */15 * * * * root sync && echo 3 > /proc/sys/vm/drop_caches
4
down vote
accepted
note: linux is not "eating" your ram! please take a look at geirha's excellent answer below to understand why...

after the above note, if you still feel "cleaning" the cache could help, you can certainly try: it's a one-liner from the terminal:

sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
there's no easy way to disable the cache, but you can achieve the same effect by cleaning it as often as every minute, if you want to:

make it a cron-job
press alt-f2, type gksudo gedit /etc/crontab, and add this line near the bottom:

*/15 * * * * root sync && echo 3 > /proc/sys/vm/drop_caches

this cleans every 15 minutes. you can set to 1 or 5 minutes if you really want to by changing the first parameter to * or */5 instead of */15
one liner to know real free ram, excepting cache
geirha's answer explains the details, but in short, you get the number of free megabytes with:

free -m | sed -n -e '3p' | grep -po "\d+$"
which on my 2gb command-line server returns an extremely health 1835.

shareimprove this answer
edited jun 27 at 9:58

answered jun 25 at 12:49

izx
39.6k44792

RAW data

Actions
Rating
Download as
View as
Actions
Edit