View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 01-03-2013, 04:50 AM   #1
LQ Newbie
Registered: Mar 2012
Posts: 8

Rep: Reputation: Disabled
How to reduce swap memory usage in Linux server

Frequently i am getting "swap memory usage is now 67%, which is above the error threshold (60%)" this error . How to reduce the swap memory usage .
Old 01-03-2013, 05:13 AM   #2
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,248

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Check which processes consume memory, for example by top, maybe they have a leak. If your server constantly require more memory to normal work, buy more RAM modules as swaping drastically decrases performance.
1 members found this post helpful.
Old 01-03-2013, 05:19 AM   #3
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 1,921

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
Find out what is using the swap and do something to it. Or just get more RAM. Swap is after all a fallback for when you run out of RAM. Traditionally anyway. You could always add more swap if need be. Use dd to create a file, format it with a swap filesystem, and add it to the swap. By no means an efficient way to do it, but one option when other options are not immediately practical.

# dd if=/dev/zero of=fake.swap bs=8M count=10
# mkswap -v 1 fake.swap
# swapon -p -1 fake.swap
# swapon -s

About the only thing that was using swap on my desktop was icedtea-web. But I only have 1GB of RAM on this relic of a machine. So now I start my browser as follows.

$ JAVA_OPTS="-Xmx128m -Xms128m" padsp iceweasel
1 members found this post helpful.
Old 01-03-2013, 11:40 AM   #4
Registered: Dec 2004
Posts: 865

Rep: Reputation: 53
You could add more memory -- it's very cheap right now.
1 members found this post helpful.
Old 01-03-2013, 05:17 PM   #5
Registered: Sep 2007
Location: Canada
Distribution: RHEL, Debian, SUSE
Posts: 34

Rep: Reputation: 1
Originally Posted by ranjithm View Post
Frequently i am getting "swap memory usage is now 67%, which is above the error threshold (60%)" this error . How to reduce the swap memory usage .

LOL I bet your system is crawling!


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 metric to monitor memory usage or swap? karlochacon Linux - Newbie 5 08-13-2011 04:49 PM
Apache crashing VPS - need to reduce memory usage rhodri Linux - Server 2 02-15-2010 04:00 AM
LXer: Tips to reduce memory usage on Firefox | Linux LXer Syndicated Linux News 0 01-24-2010 04:01 PM
Memory and swap usage ? czezz Solaris / OpenSolaris 6 09-03-2008 05:51 AM
Memory / Swap Usage RoaCh Of DisCor Linux - Newbie 16 05-19-2005 03:45 PM

All times are GMT -5. The time now is 05:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration