LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Problem in clearing up cache when it reaches half of ram size (https://www.linuxquestions.org/questions/linux-server-73/problem-in-clearing-up-cache-when-it-reaches-half-of-ram-size-4175423551/)

LittleMaster 08-23-2012 02:30 AM

Problem in clearing up cache when it reaches half of ram size
 
Dear All
Im currently the following running following command

sudo sync && sudo sysctl -w vm.drop_caches=3 && sudo sysctl -w vm.drop_caches=0


very half hour to clear cache of my server .Im currently trying to clear cache when it reaches only half of my Ram size .Any help regarding it how can i execute these command when it reach half of my ram size


[root@localhost ~]# free -m
total used free shared buffers cached
Mem: 3823 535 3288 0 41 351
-/+ buffers/cache: 142 3680
Swap: 6047 0 6047

evo2 08-23-2012 02:38 AM

Hi,

why do you want to do this?

Evo2.

johnsfine 08-23-2012 06:31 AM

Quote:

Originally Posted by LittleMaster (Post 4761823)
Im currently trying to clear cache when it reaches only half of my Ram size .

Quote:

Originally Posted by evo2 (Post 4761824)
why do you want to do this?

My opinion is probably implied by evo2's question, but making it more explicit:

A lot of Linux users think there is some good reason to stop the cache from filling the rest of memory (beyond what is used for everything else). In almost all cases THEY ARE WRONG.

unSpawn 08-23-2012 07:24 AM

Quote:

Originally Posted by johnsfine (Post 4761991)
A lot of Linux users think there is some good reason to stop the cache from filling the rest of memory (beyond what is used for everything else). In almost all cases THEY ARE WRONG.

...and to expand upon that: that's because they don't know the Linux kernel has a Virtual Memory Manager (VMM) that works OK ninety nine percent of the time for most purposes. Yes, there's a lot of VMM-related sysctls that can be tweaked but doing so before having baseline SAR stats and having pinpointed the bottleneck(s) makes no sense.

chrism01 08-23-2012 07:54 PM

@OP: as with the above comments, you (almost definitely) don't want to be doing that.
Try reading this
http://www.linuxatemyram.com/


All times are GMT -5. The time now is 09:34 AM.