LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-17-2009, 10:42 PM   #1
smuro
LQ Newbie
 
Registered: Jun 2009
Posts: 9

Rep: Reputation: 0
All my 8 GB of RAM Consumed


Hi
I have just installed mysql-server to the the HP dl580g5 running centos 5.2. before this installation, memory usage was 700k out of 8G but now the whole 8G is consumed

Can someone advice why this is happening. Im running kernel 2.6.18-92.el5xen

I can also see that more than 7.5 G is inactive!! Please advice

<code>
[root@tzvodapbx09 backups]# cat /proc/meminfo
MemTotal: 8178688 kB
MemFree: 54936 kB
Buffers: 35328 kB
Cached: 7692360 kB
SwapCached: 0 kB
Active: 193248 kB
Inactive: 7590620 kB
HighTotal: 7441172 kB
HighFree: 22388 kB
LowTotal: 737516 kB
LowFree: 32548 kB
SwapTotal: 2031608 kB
SwapFree: 2031608 kB
Dirty: 320 kB
Writeback: 0 kB
AnonPages: 56668 kB
Mapped: 17644 kB
Slab: 167140 kB
PageTables: 3228 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 6120952 kB
Committed_AS: 323552 kB
VmallocTotal: 114680 kB
VmallocUsed: 6672 kB
VmallocChunk: 107932 kB
[root@tzvodapbx09 backups]#

</code>

<code>
top - 06:37:26 up 2:47, 2 users, load average: 0.44, 0.29, 0.19
Tasks: 261 total, 1 running, 258 sleeping, 2 stopped, 0 zombie
Cpu(s): 0.4%us, 0.2%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 8178688k total, 8021296k used, 157392k free, 36548k buffers
Swap: 2031608k total, 0k used, 2031608k free, 7587356k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
21845 root 15 0 38828 12m 6360 S 4 0.2 0:10.59 asterisk
1 root 15 0 2080 640 548 S 0 0.0 0:01.02 init
2 root RT -5 0 0 0 S 0 0.0 0:00.03 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0 0.0 0:00.03 migration/1
6 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/1
7 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/1
8 root RT -5 0 0 0 S 0 0.0 0:00.02 migration/2
9 root 39 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/2
10 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/2
11 root RT -5 0 0 0 S 0 0.0 0:00.04 migration/3
12 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/3
13 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/3
14 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/4
15 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/4
16 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/4
17 root RT -5 0 0 0 S 0 0.0 0:00.02 migration/5
18 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/5
19 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/5
20 root RT -5 0 0 0 S 0 0.0 0:00.01 migration/6
21 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/6
22 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/6
23 root RT -5 0 0 0 S 0 0.0 0:00.03 migration/7
24 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/7
25 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/7
26 root RT -5 0 0 0 S 0 0.0 0:00.02 migration/8
27 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/8
28 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/8
29 root RT -5 0 0 0 S 0 0.0 0:00.01 migration/9
30 root 39 19 0 0 0 S 0 0.0 0:00.02 ksoftirqd/9
31 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/9
32 root RT -5 0 0 0 S 0 0.0 0:00.02 migration/10
33 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/10

Sam
</code>
 
Old 07-18-2009, 01:25 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
What's the perceived problem? The RAM is mostly used for caching,
and there's nothing wrong with that.


Cheers,
Tink
 
Old 07-18-2009, 01:26 AM   #3
ddaemonunics
Member
 
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242

Rep: Reputation: 41
http://www.scottklarr.com/topic/134/...e-from-memory/

[edited]
MAKE SURE YOU READ TO THE LAST POST ..posted by Romy Maxwell
1.It's ok to have almost 100% cached memory.
2.You should NOT manually clear the cache.
3.You can manually clear the cache.
4.Make sure you read official documents/documentation before making decisions that affect the state of the system.

Last edited by ddaemonunics; 07-20-2009 at 01:09 AM.
 
Old 07-18-2009, 02:18 AM   #4
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Quote:
Originally Posted by ddaemonunics View Post
I don't know specifics about what it is that guy on that blog is running (no version numbers or anything like that) but I will say, if he has to continually perform that task, something else is wrong with the setup of that system. I've never had (or heard of anyone else until now having) to force flush memory caches or reboot systems on a regular basis for memory cache usage reasons. I'd dig deeper into what is actually using the memory before I took that approach...
 
Old 07-18-2009, 06:05 AM   #5
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 jtshaw View Post
I've never had (or heard of anyone else until now having) to force flush memory caches
If you read Linux forums, I'm sure you've heard of a lot of people who think they have to flush the cache.

They misunderstand the Linux memory statistics as the OP of this thread did, and think there is a problem when there actually is no problem.

For the OP: Look at the part of your top output that says "7587356k cached". Under most conditions you should interpret that memory as if it were just another kind of free memory. For most purposes it will act like free memory.

As for the guy in that blog, my best guess is that the performance symptoms he reported are imagined rather than measured and he had no real issue with caching.

However, both Linux and Windows have the flaw that they do not properly prioritize memory use according to task priority, so there are instances of a strange feedback situation of inverted priority:
Low priority tasks might have all the pages they want to access in the page cache while the high priority task has the pages it wants on disk. The high priority task can't use the CPU because it is waiting for a page to be brought in, so the low priority tasks use the CPU and fault their pages in instantly from the cache. When the high priority task gets the page it was waiting for, it immediately faults on another page on disk and the pattern continues. The high priority task makes so little progress that most of its pages have not been accessed for a long time and they get dropped from ram, assuring that it will continue faulting almost every access indefinitely. The pages used by the low priority tasks are all accessed often enough to keep them from ever aging out of the cache.

In normal situations, the direct priority over CPU use results in an indirect effect that pages of high priority tasks are accessed more resulting in correct prioritization of memory without any direct prioritization of memory. But on rare occasions, that breaks down. If the blog description was true, most likely it is the result of some such priority inversion.

For the OP, if the mysql-server is a background task and you want interactive tasks to get priority over it, you have the basic conditions that could allow a priority inversion. But a priority inversion also requires serious "memory pressure", which is absolutely not the case in the memory use statistics you quoted.
 
Old 07-18-2009, 07:07 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by ddaemonunics View Post
Ummm ... not sure what that guys problem is, but it's not
the solution to his underlying issues. I've been using
Linux on desktops and servers in many flavours and
variations, with RAM from as little as 96MB to as much as
16GB, for well over 10 years, and not once felt the need
to force cached content out of RAM. Pity so many people
on his blog seem to think he's onto something ;p




Cheers,
Tink


P.S.: I wish you hadn't spread that crap to LQ =D

Last edited by Tinkster; 07-18-2009 at 07:08 PM.
 
Old 07-18-2009, 07:41 PM   #7
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Quote:
Originally Posted by smuro View Post
Cached: 7692360 kB
Yea, this is that same meaningless (not actually meaningless, but don't worry about it for now) line from free that I used to read and get worried about.

Code:
jameson@salmon:/var/log$free
             total       used       free     shared    buffers     cached
Mem:       3979876    3953180      26696          0     134168    2739560
-/+ buffers/cache:    1079452    2900424
Swap:      7815580     122048    7693532
Bold matters, italic doesn't, in short.

Last edited by jhwilliams; 07-18-2009 at 07:48 PM.
 
Old 07-18-2009, 07:45 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,237

Rep: Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150
I can't reach that blog, but I guess it discusses drop_caches.
If starting mysql_server prefetches (and eats disk cache) like that, you'd sure not want to drop them.
On a small/quiet system it probably won't matter, but is pointless. Otherwise it's likely to be harmful to (at least) performance.

I just sat in on a talk by one of the drizzle devs - they plan on page-fixing that proportion of storage on startup. Think about the questions that'll raise in future (used rather than just cached).
 
Old 07-18-2009, 11:04 PM   #9
speck
Member
 
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 375

Rep: Reputation: 115Reputation: 115
smuro, your system is using about 400MB of RAM.

8178688 - 54936 - 35328 - 7692360 = 396064kB

The following command will also show you how many megabytes of RAM you're using:

Quote:
free -m | grep 'buffers/cache' | awk '{print $3}'
 
Old 07-19-2009, 01:54 AM   #10
ddaemonunics
Member
 
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242

Rep: Reputation: 41
I didn't posted that link so that he will do the same thing...only to better understand the problem(if it is one)...on that blog the users already said that manually flushing the cache is not a solution.
I quote (from that blog):

[quote]:
On that note... for most applications, regularly clearing the cache is like chopping off both arms to cure a pinky infection. The cache exists for a reason -- it eliminates TONS of disk accesses. If you clear the cache, you will always have to load everything from disk, defeating its purpose and effectively wasting that memory.

The likely problem is that you have something running in the background, maybe an indexing service, that is filling up your cache and causing disk IO. Chances are, if you reduce your swappiness, or locate the culprit(s), or both, you won't have anymore problems.:[quote]

Last edited by ddaemonunics; 07-19-2009 at 03:06 AM.
 
Old 07-19-2009, 02:09 AM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by ddaemonunics View Post
I didn't posted that link so that he will do the same thing...only to better understand the problem...on that blog the users already said that manually flushing the cache is not a solution.
I quote (from that blog):
Sorry, if it was your intention to point out Romy Maxwells
post it almost certainly fails; it's toward the end of a whole
heap of short "thumbs up" and "awesome" and "thanks
a ton" responses. Even if people who are ill informed about
Linux memory usage read the whole blog they'll conclude
that the one poster against that practice must be an idiot.



Cheers,
Tink
 
Old 07-19-2009, 03:21 AM   #12
ddaemonunics
Member
 
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242

Rep: Reputation: 41
We all use Linux servers from home made to professional ones...and we all know tools like vmstat and ps and how to read /proc/<PID>/maps /proc/<PID>/status etc..

maybe the fact that I've learned all by myself ..by reading stuff and buying books sometimes makes me post links to other discussions rather that explaining..

There should be a rule..before making a post(looking for an answer)..make proof that you have tried to read some documentation before

So maybe my post was not the most "inspired"...hope that smuro didn't rebooted his server

So ...to make up...the right post should have been..
http://www.linuxhowtos.org/System/Li...Management.htm

Last edited by ddaemonunics; 07-19-2009 at 03:29 AM.
 
Old 07-19-2009, 03:34 AM   #13
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Quote:
Originally Posted by ddaemonunics View Post
maybe the fact that I've learned all by myself ..by reading stuff and buying books sometimes makes me post links to other discussions rather that explaining..

There should be a rule..before making a post(looking for an answer)..make proof that you have tried to read some documentation before
Yea ditto. I reply to mad quants of nubie bs on this mofo. But that's just it: when you're noob you're noob, you don't even know that "rtfm" means "bracket code bracket man topic bracket slash code end braket." A big part for me when I was starting was just gaining access to the documents. Even when you do, it takes years of googling, wikipedia, howtos, posts, etc., just to understand what a man page is telling you. Linux isn't easy --if it does seem so, it's only because we spend our lives using and developing it. It's even harder for those of us who grew up without UNIX, or those that didn't get a technical (let alone Computer Science) degree.

My post here strays from the topic. I think we've adequately pointed the OP at the appropriate info.

Quote:
Originally Posted by jtshaw View Post
I will say, if he has to continually perform that task, something else is wrong with the setup of that system. I've never had (or heard of anyone else until now having) to force flush memory caches or reboot systems on a regular basis for memory cache usage reasons.
Nor have I. That sounds wicked ghetto. Like a mal-configured kernel from 1995.

Last edited by jhwilliams; 07-19-2009 at 03:49 AM.
 
Old 07-19-2009, 06:13 AM   #14
smuro
LQ Newbie
 
Registered: Jun 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Wink

Thanks jhwilliams and everyone.

As johnsfine said, its confusing not only to people but even to the monitoring application that give realtime and historical memory utilization of the system for proactive action

Otherwise the system in question runs asterisk pbx but i have been facing performance problem

Its clear that the memory in not an issue.

Thanks
 
  


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 consumed by a process ZAMO Linux - General 1 02-19-2009 09:22 AM
how can i find space consumed by this user izrafel Linux - General 3 06-15-2007 04:21 AM
CPU consumed time with millisecond resolution. lofrbo Linux - General 4 12-20-2005 12:08 PM
CPU consumed time with millisecond resolution. lofrbo Linux - Software 2 11-18-2005 10:46 AM
kjournald process consumed all CPU time tttx Linux - General 1 05-11-2005 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:23 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