LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-02-2015, 02:24 AM   #1
kulpreet11
LQ Newbie
 
Registered: Dec 2010
Posts: 23

Rep: Reputation: 0
Linux Memory Issues


Hi,

I have been facing memory issue on one of my linux server very frequently. All the memory is going in cached and free memory remains very less.

I have also setup a cron to clear cached memory in every half hour.
*/30 * * * * sync;echo 3 > /proc/sys/vm/drop_caches;sync

Still it keeps large amount of memory in cached.

Please check below the output of free command.

free -m
total used free shared buffers cached
Mem: 20062 15353 4708 0 37 9963
-/+ buffers/cache: 5352 14709
Swap: 12291 4294 7997

Any solution is helpful.

Regards,
Kulpreet
 
Old 03-02-2015, 02:25 AM   #2
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Please read this link:
http://www.linuxatemyram.com/
 
Old 03-02-2015, 05:55 AM   #3
kulpreet11
LQ Newbie
 
Registered: Dec 2010
Posts: 23

Original Poster
Rep: Reputation: 0
Hi,

I know the free memory is not what is shows there. I want to know how the cached memory gets increased every time.

Sorry if it sounds silly but a new bee here.

Regards,
Kulpreet
 
Old 03-02-2015, 06:11 AM   #4
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 kulpreet11 View Post
I know the free memory is not what is shows there. I want to know how the cached memory gets increased every time.

Sorry if it sounds silly but a new bee here.
Did you read that link? If so, did you make some attempt to do so with an open mind, rather than rejecting anything that doesn't fit your preconceptions?

Your first posts shows exactly the misunderstanding of Linux memory that the LinuxAteMyRam page was written to correct.

Then your second post seems to show you haven't understood that page.

You will find almost every expert in this forum agrees with the ideas expressed in that page. It isn't really a matter of opinion, but fact. You agree with that information or you are incorrect.

Your cron job to drop cache was and is a bad idea. Get rid of it and stop being bothered by the correct operation of your system, which includes having ram used by cache
 
Old 03-02-2015, 06:16 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,188

Rep: Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131Reputation: 4131
Did you read the link above ?.

The (disk) caching increases after you flush it (with drop_caches) because your applications want the data you just flushed.
Do not use drop_caches - you are slowing down your system (by forcing more reads from disk). Your applications want access to that data, you are slowing them down.
 
Old 03-02-2015, 09:57 AM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by kulpreet11 View Post
I have been facing memory issue on one of my linux server very frequently.
I think not
Quote:
Originally Posted by kulpreet11 View Post
All the memory is going in cached and free memory remains very less.
So?

Quote:
Originally Posted by kulpreet11 View Post
I have also setup a cron to clear cached memory in every half hour.
*/30 * * * * sync;echo 3 > /proc/sys/vm/drop_caches;sync
Bad idea, get rid of it

Quote:
Originally Posted by kulpreet11 View Post
Still it keeps large amount of memory in cached.
Again, so?

Quote:
Originally Posted by kulpreet11 View Post
Please check below the output of free command.

free -m
total used free shared buffers cached
Mem: 20062 15353 4708 0 37 9963
-/+ buffers/cache: 5352 14709
Swap: 12291 4294 7997
Looks normal to me. Memory being used for disk cache will be automatically freed as soon as an application needs it. If an application doesn't need it, the system uses it for disk cache to speed up reads. Forcing the system to dump the cache is just dumb. The memory isn't being used for anything else, so why not use it to cache files from the disk until it's needed?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
memory issues vbsaltydog Red Hat 2 02-21-2006 04:59 PM
SuSE memory issues? Or not? kripkenstein SUSE / openSUSE 2 01-23-2006 09:25 AM
Slackware Linux RAM/Memory Issues Darvocet Slackware 6 05-25-2005 03:16 PM
Still having Free memory issues..? sspiro Linux - Software 14 04-07-2005 06:13 PM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:37 PM.

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