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 9 months ago 998 years 2 months 1.11 KB
Views Downloads Status Password Short URL Embedded code
5279 149 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
  1. 4
  2. down vote
  3. accepted
  4. note: linux is not "eating" your ram! please take a look at geirha's excellent answer below to understand why...
  5.  
  6. 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:
  7.  
  8. sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
  9. 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:
  10.  
  11. make it a cron-job
  12. press alt-f2, type gksudo gedit /etc/crontab, and add this line near the bottom:
  13.  
  14. */15 * * * * root sync && echo 3 > /proc/sys/vm/drop_caches
  15.  
  16. 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
  17. one liner to know real free ram, excepting cache
  18. geirha's answer explains the details, but in short, you get the number of free megabytes with:
  19.  
  20. free -m | sed -n -e '3p' | grep -po "\d+$"
  21. which on my 2gb command-line server returns an extremely health 1835.
  22.  
  23. shareimprove this answer
  24. edited jun 27 at 9:58
  25.  
  26. answered jun 25 at 12:49
  27.  
  28. izx
  29. 39.6k44792

RAW data

Actions
Rating
Download as
View as
Actions
Edit