LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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-10-2008, 05:04 PM   #1
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Rep: Reputation: 30
Does process memory usage drop?


I have Apache+MySQL running on CentOS. The total memory usage started off at 140MB. I made a few clicks on a phpBB site on the server and the memory went to 172MB. It doesn't seem to be going down. I have a memory limit and I'm afraid of hitting it if memory usage continues to go up and never back down.
(I'm the only one who accesses this server at this time, so it's not like other people are hitting the server)

Will the memory usage by MySQL and Apache eventually drop back down to normal?

And I see like 8 httpd processes running, each taking up 35k KB or so. Is this normal?

Last edited by Zeno McDohl; 07-10-2008 at 05:33 PM.
 
Old 07-10-2008, 07:51 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,352

Rep: Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041
Maybe - read this and see if it answers (some of) your concerns.
 
Old 07-10-2008, 10:13 PM   #3
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Original Poster
Rep: Reputation: 30
Seems a bit advanced for me (which is why I posted in the newbie area).

I have a 256MB Memory limit on this VPS and I'm just worried if the memory continues to go up and hit the limit.
 
Old 07-10-2008, 11:40 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,352

Rep: Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041
The basic premise is "you've paid for the memory, why not use it ???." Consequently you get things like cache and buffers eating up otherwise "free" memory - this is a performance enhancement that costs "nothing". If your applications need more memory, cache/buffers shrink to accommodate. Hence you may see the memory "all used", but it won't hinder your (apps) performance.
Linux also uses "lazy" allocation - freed memory appears still allocated to the process until some time later; usually when someone else needs it.

That's the 10,000 ft view - good in theory. Presumes you have well behaved apps and sufficient resources. Swap is the answer to immediate memory shortages - slow, but useful.
Badly behaved apps (with a memory leak say) will continue to eat memory, then swap, then things start getting killed. This is not a memory problem, it's an application problem. You'll only really know if you have a real problem if you track the usage and see a pattern - sar is useful for that.

So the answer is - "it depends". Here's a quick script I did in answer to someone else a few weeks back - run it every so often and watch the numbers; maybe write it to a file
Code:
free -m | awk '{if (NR == 2) tot = $2; else if (NR == 3) used = $3} END{print "Memory usage: " used " of " tot " Megabytes}'
 
  


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
how to show the memory usage per process ty263 Linux - General 3 09-12-2008 06:36 AM
getrusage and process memory usage gearoid_murphy Programming 2 11-09-2006 04:33 AM
how to programmatically monitor a process memory usage? thanhvn Linux - Software 1 11-15-2005 08:44 PM
about displaying process memory usage maginotjr Slackware 2 09-13-2005 11:43 AM
Process memory usage wombat53 Linux - Newbie 5 07-21-2005 07:42 PM


All times are GMT -5. The time now is 01:20 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration