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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-17-2009, 10:42 PM
|
#1
|
LQ Newbie
Registered: Jun 2009
Posts: 9
Rep:
|
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>
|
|
|
07-18-2009, 01:25 AM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
What's the perceived problem? The RAM is mostly used for caching,
and there's nothing wrong with that.
Cheers,
Tink
|
|
|
07-18-2009, 01:26 AM
|
#3
|
Member
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242
Rep:
|
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.
|
|
|
07-18-2009, 02:18 AM
|
#4
|
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Rep:
|
Quote:
Originally Posted by ddaemonunics
|
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...
|
|
|
07-18-2009, 06:05 AM
|
#5
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
|
Quote:
Originally Posted by jtshaw
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.
|
|
|
07-18-2009, 07:07 PM
|
#6
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally Posted by ddaemonunics
|
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.
|
|
|
07-18-2009, 07:41 PM
|
#7
|
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168
|
Quote:
Originally Posted by smuro
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.
|
|
|
07-18-2009, 07:45 PM
|
#8
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,237
|
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).
|
|
|
07-18-2009, 11:04 PM
|
#9
|
Member
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 375
Rep:
|
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}'
|
|
|
|
07-19-2009, 01:54 AM
|
#10
|
Member
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242
Rep:
|
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.
|
|
|
07-19-2009, 02:09 AM
|
#11
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally Posted by ddaemonunics
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
|
|
|
07-19-2009, 03:21 AM
|
#12
|
Member
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242
Rep:
|
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.
|
|
|
07-19-2009, 03:34 AM
|
#13
|
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168
|
Quote:
Originally Posted by ddaemonunics
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
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.
|
|
|
07-19-2009, 06:13 AM
|
#14
|
LQ Newbie
Registered: Jun 2009
Posts: 9
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 07:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|