LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-04-2005, 08:39 PM   #1
MatchFlickSeth
LQ Newbie
 
Registered: Apr 2005
Location: San Francisco, CA
Posts: 3

Rep: Reputation: 0
understanding swap memory


I have a VPS and have been having some trouble the last few days with it crashing. I can restart it, and everything is fine for about a day, then the same thing happens again.

The last time it did so, I noticed the swap memory was full. So, since this last restart, I've been monitoring 'top' a lot.

Here's the latest readout:

CPU states: cpu user nice system irq softirq iowait idle
total 0.1% 0.0% 0.3% 0.0% 0.0% 0.0% 99.4%
Mem: 189036k av, 173344k used, 15692k free, 0k shrd, 4712k buff
79240k active, 85764k inactive
Swap: 262136k av, 132960k used, 129176k free 51164k cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
1011 root 18 19 6796 5664 4940 S N 0.0 2.9 0:00 0 cpanellogd
824 root 8 0 4800 3452 3432 S 0.0 1.8 1:04 0 httpd
996 mailnull 9 0 4648 2924 2924 S 0.0 1.5 0:00 0 eximstats
947 mysql 9 0 3636 2880 2296 S 0.0 1.5 0:13 0 mysqld
740 root 8 0 3228 2248 1884 S 0.0 1.1 0:00 0 chkservd
696 named 9 0 2304 2204 1812 S 0.0 1.1 0:00 0 named

Nothing's taking up a ton of memory or cpu usage. However, the size of 'used' swap memory has been climbing since the last restart. I have a feeling that when it fills up, the server will crash, and we'll do the whole thing over again.

So, my questions are:

1) Is the swap memory supposed to clear after use? I mean, there's plenty of free space after each time it is used (another issue), shouldn't it start going down again?

2) What are some things that can cause the swap memory to come into play very quickly (even with top running, I haven't been able to spot it jump) when everything else is normal?

Thanks much all,
Seth
 
Old 04-04-2005, 11:16 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
It sounds like you have a "memory leak". this a condition where memory is allocated, but never released. Older allocated memory that hasn't been recently referenced is placed into swap to free up RAM. In your case, it looks like that process is continuing until swap is full. I suggest you try to isolate the application/service causing the problem (avoid using things you've been using when you note the problem) and open a bug report with your distribution vendor.
 
Old 04-04-2005, 11:34 PM   #3
MatchFlickSeth
LQ Newbie
 
Registered: Apr 2005
Location: San Francisco, CA
Posts: 3

Original Poster
Rep: Reputation: 0
Thus far, my hosting provider has been no help.

I just noticed that the swap usage did go down tonight, from 4176k to 4152k. It's not much, but at least it shows that it can go down.

As for the leak issue, I really have no idea what could cause it. For the most part, the server runs at optimal memory and cpu usage. Then, all of a sudden (about once a day since Friday, at different times) it fills up and crashes. It's a web server, so I'm not doing anything special at the time. In fact, I haven't even been logged into the machine when it's occured.

So, I guess I will just continue to keep my eye on it and hope I can spot the culprit in the act.

Quote:
Originally posted by macemoneta
It sounds like you have a "memory leak". this a condition where memory is allocated, but never released. Older allocated memory that hasn't been recently referenced is placed into swap to free up RAM. In your case, it looks like that process is continuing until swap is full. I suggest you try to isolate the application/service causing the problem (avoid using things you've been using when you note the problem) and open a bug report with your distribution vendor.
 
Old 04-05-2005, 12:27 PM   #4
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Check out the 'free' command as well to get some good memory statistics.

Dumb question, what is a VPS? Do you maintain the server and its software?
 
Old 04-05-2005, 03:23 PM   #5
MatchFlickSeth
LQ Newbie
 
Registered: Apr 2005
Location: San Francisco, CA
Posts: 3

Original Poster
Rep: Reputation: 0
The problem isn't seeing the memory statistics (I've been watching 'free' and 'top' for 2 days), but figuring out why the swap memory is being used when memory usage is not very high at all. So far, no one has been able to figure out why.

A VPS is a Virtual Private Server. It's a cheaper option than a dedicated server for a hosting solution. The hosting company is in charge of more general server maintenance and software, where as I take care of the smaller details. When something goes wrong, both parties try to solve it.

Quote:
Originally posted by Crashed_Again
Check out the 'free' command as well to get some good memory statistics.

Dumb question, what is a VPS? Do you maintain the server and its software?
 
Old 04-05-2005, 06:04 PM   #6
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
kernel version and patchset (or patches applied)?
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swap Memory xbill311x Linux - Newbie 2 04-11-2005 01:58 PM
Swap being used before memory gone bmiley_ncaa Linux - Hardware 2 09-29-2004 03:53 PM
no memory swap os2 Programming 2 06-11-2004 12:32 PM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM
Swap Memory in use or not? Qebex Linux - Hardware 5 09-21-2002 07:59 AM


All times are GMT -5. The time now is 11:56 PM.

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