LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-02-2015, 04:21 PM   #1
kox444
Member
 
Registered: Aug 2012
Posts: 128

Rep: Reputation: Disabled
800MB of swap used while 2GB of RAM available


I've noticed that sometimes swap is used even when there's plenty of memory. For example just now I've had 2 out of 4GB ram used and additional 800mb of swap used. I had to swap off, because the performance drop caused by this is unbearable. Shouldn't the swap only be used when out of ram? I don't know maybe I approached the limit, but I highly doubt it. It would have to be at least 4.8GB of used memory to make sense. I watched a movie and then noticed the performance drop, but I doubt the movie would occupy 2GB of ram.
Even if there's a situation when I run out of ram and swap is used, shouldn't the contents of swap go back to ram automatically when some ram is freed? It just doesn't make any sense to have 2GB of ram available and use 800mb of swap. It isn't the first time I had to swap off because of system being super slow.
 
Old 04-02-2015, 04:27 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by kox444 View Post
Shouldn't the swap only be used when out of ram?
No - see swappiness:
http://en.wikipedia.org/wiki/Swappiness

Quote:
Originally Posted by kox444 View Post
Even if there's a situation when I run out of ram and swap is used, shouldn't the contents of swap go back to ram automatically when some ram is freed?
No, the data will stay in swap until it's needed again.
 
1 members found this post helpful.
Old 04-03-2015, 01:55 AM   #3
kox444
Member
 
Registered: Aug 2012
Posts: 128

Original Poster
Rep: Reputation: Disabled
Thanks
 
  


Reply

Tags
linux, ram, swap



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
Finding out what RAM chip needed to upgrade from 2GB to 4GB RAM. farmerluk Linux - Hardware 4 11-17-2011 12:02 PM
Why size of swap space is 2x of RAM??? Why not 1.5x of RAM or 2.5x of RAM??? Saurav Ghosh Linux - Newbie 7 11-01-2011 03:49 AM
Rsync taking up all Ram, 800MB! humbletech99 Linux - Software 6 02-27-2007 03:19 PM
2GB swap limit twantrd Linux - General 2 10-19-2004 08:56 PM
addressing more than 2GB swap in Linu JapanMtlExpat Linux - Software 0 10-05-2004 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:58 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration