LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-23-2012, 02:30 AM   #1
LittleMaster
Member
 
Registered: Jun 2012
Posts: 121
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 08-23-2012, 02:38 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

why do you want to do this?

Evo2.
 
Old 08-23-2012, 06:31 AM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by LittleMaster View Post
Im currently trying to clear cache when it reaches only half of my Ram size .
Quote:
Originally Posted by evo2 View Post
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.
 
Old 08-23-2012, 07:24 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by johnsfine View Post
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.
 
Old 08-23-2012, 07:54 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing the Cache. surisourabh Programming 2 04-14-2009 05:08 AM
clearing CD cache grayFalcon Programming 1 09-21-2006 04:55 PM
clearing cache, web cache on linux varunbihani Linux - General 2 12-08-2005 12:02 PM
DNS cache clearing n.antonio Linux - Software 0 05-11-2003 08:44 PM
clearing cache waxiem Linux - General 1 03-02-2003 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration