[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4668: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4670: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4671: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4672: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
Void's Forums • View topic - flush out swap

flush out swap

Place to discuss Fedora and/or Red Hat

flush out swap

Postby cdhgold » Tue Jul 10, 2007 1:25 pm

what is a command that will flush out the swap usage without rebooting?
User avatar
cdhgold
administrator
administrator
 
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

Postby Void Main » Tue Jul 10, 2007 1:51 pm

User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby insomnia » Tue Jul 10, 2007 7:52 pm

insomnia
programmer
programmer
 
Posts: 123
Joined: Thu Feb 05, 2004 6:58 pm
Location: Belgium, Antwerp

Postby Void Main » Tue Jul 10, 2007 8:14 pm

User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Master of Reality » Tue Jul 10, 2007 8:46 pm

Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby insomnia » Thu Jul 12, 2007 9:20 pm

insomnia
programmer
programmer
 
Posts: 123
Joined: Thu Feb 05, 2004 6:58 pm
Location: Belgium, Antwerp

Postby Void Main » Thu Jul 12, 2007 9:55 pm

I have actually run into this many times on Linux and UNIX (and on Windows years ago when I actually occasionally used it). When I run into the problem is usually because of a program with a memory leak that would slowly consume more an more memory.

That's not always the case though. In fact I was having an issue with the Void server locking up every couple of weeks recently and it was because of a compounding problem. I am running Cacti on the Void web server to graph some things including weather in my neighborhood. I have a script that scrapes accuweather's web site every 5 minutes when the Cacti poller runs to gather weather data. Well, if my network connection goes down (like it does a lot with Charter) then this script would just hang (bad programming on my part). So, while the network was down another copy of this script would run and hang every 5 minutes.

Over time there would be so many scripts running that it eventually consumed all of the memory. When you don't have any more memory new programs can not be run and programs that are already running can't allocate more memory. This of course means you probably won't be able to log on or ssh in because a new login/ssh process can not be started so you pretty much have to push the reset button at this point.

Of course if you have your "limits.conf" configured properly (/etc/security/limits.conf on RedHat/Fedora and many other systems) a normal user would only be able to allocate a maximum of 'x' amount of memory and run a maximum of 'x' number of processes. If I had this set up then the user that my Cacti processes run under wouldn't have been able to use up all the memory and I would have been able to log into the system and fix it.

The Void server is sort of low on my priority list so I let this go for a while before actually digging into it to see what the problem was and when it happened I would just call home and have one of my kids push the reset button. It's fixed now but you can see exactly when this happened by the following graphs.

Here you can see when the number of processes had built up:

Image

Here you should see a correlation of memory being eaten up until there was no swap left and the system came to a screeching halt:

Image

Here's one of the weather graphs that I was creating with the problem script:

Image

See the man page for limits.conf:

http://voidmain.is-a-geek.net/man?param ... f&mode=man

That default Cacti memory graph pretty much sucks. I use Cacti at work for some things and I have created a custom memory graph that shows in more detail the different types of memory Linux uses and how much is available. Real memory is displayed as positive numbers and swap is displayed as negative numbers so I can see both real memory and swap memory on one graph. Here is an example:

Image

I actually could provide a couple of really good examples where you would see all of the real memory getting eaten up followed by swap but I'm not at work right now so this is the only snapshot I happened to find on my laptop. Basically the black line at the top represents to total amount of real memory installed on the system and the black line on the bottom represents the size of the swap. The white space actually indicates how much memory is in use, all the other colors indicate amount of that type of memory that is available for use.

Here's another:

Image
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 4 guests

cron