LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-31-2011, 05:23 AM   #1
kamesh419
LQ Newbie
 
Registered: Nov 2005
Posts: 27

Rep: Reputation: 0
SWAP usage zero all the time


Hi all,

No matter what I do, the SWAP usage remains zero all the time. Is there anything I am missing?

In the following case (see attached screenshot) I am running make on the kernel that I downloaded. The CPU usage is understandable. But what is the use of Swap when its never used.

http://imageshack.us/photo/my-images/14/snapshoth.png/

I am on Kubuntu natty.

My partitions are as follows:

Quote:
Kamesh@Galaxy:~$ sudo fdisk -l
[sudo] password for:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x88fa88fa

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9615 77232456 7 HPFS/NTFS
/dev/sda2 9616 19458 79056897 5 Extended
/dev/sda5 9616 18960 75057152 83 Linux
/dev/sda6 18960 19458 3998720 82 Linux swap / Solaris

Thank you for your time,
Kamesh.

Last edited by kamesh419; 05-31-2011 at 06:10 AM.
 
Old 05-31-2011, 05:31 AM   #2
droyden
Member
 
Registered: Feb 2007
Location: UK
Posts: 150

Rep: Reputation: 19
Your RAM usage is only at 1gb so no need to use swap, that is a good thing
 
Old 05-31-2011, 05:47 AM   #3
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,753

Rep: Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935Reputation: 935
I agree with droyden, with 1GB used of 3.9GB you dont want to use swap.

If for some reason you really wanted to use swap at that level of RAM use and avaiblity, you can change the 'swappiness' settings. I wouldnt bother.

Last edited by cascade9; 05-31-2011 at 10:54 AM.
 
Old 05-31-2011, 10:28 AM   #4
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,671

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
Swap was usefull when you only had 128Mb of memory and were running applictaions which were greater in size either individually or when simultaneously loaded. With modern systems having 4Gb+ of memory, it's more difficult to "fill up" the main memory.
You can probably get away without any swap in these cases. Swap was also used for Core dumps but I'm not sure if that's still true.

Play Bonny!
 
Old 05-31-2011, 10:57 AM   #5
kamesh419
LQ Newbie
 
Registered: Nov 2005
Posts: 27

Original Poster
Rep: Reputation: 0
I remember that ubuntu/kubuntu forces one to have a swap partition during installation.

Thanks for your replies. :-)
 
Old 05-31-2011, 11:03 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by kamesh419 View Post
Hi all,

No matter what I do, the SWAP usage remains zero all the time. Is there anything I am missing?

In the following case (see attached screenshot) I am running make on the kernel that I downloaded. The CPU usage is understandable. But what is the use of Swap when its never used.

http://imageshack.us/photo/my-images/14/snapshoth.png/

I am on Kubuntu natty.

My partitions are as follows:




Thank you for your time,
Kamesh.
Find a few JPEG's taken with a 12 Megapixel camera, and edit them
in the gimp ... that ought to get your machine swapping. Or keep
using it for a few days ... w/ an uptime of 3 hours, and not much
loaded there won't be much swapping going on.



Cheers,
Tink
 
Old 07-11-2011, 02:49 PM   #7
tlhonmey
LQ Newbie
 
Registered: Nov 2008
Posts: 18

Rep: Reputation: 5
Swap also gets used if you "hibernate" the computer. That's why they generally recommend having at least as much swap as ram. If you don't, you may not be able to use that option.

Otherwise, linux doesn't swap unless it needs to, so don't worry about it.
 
Old 07-11-2011, 04:00 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,937

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
I am not sure swap file gets used as hibernate or sleep but that may be new to me.


There isn't really a downside to having a swap file or partition for most users.


Just leave it or as above test it or adjust to force it. But really, don't fool with it.
 
  


Reply

Tags
swap


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
CPU usage shooting almost aFC 13 hangs from time to time eliassal Fedora 19 11-18-2010 03:32 AM
How much swap usage is too much? sneakyimp Linux - Hardware 3 11-30-2006 04:48 PM
swap usage pingvina Linux - Software 4 02-24-2006 12:52 PM
Swap Usage ComputerErik Slackware 3 05-06-2005 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:03 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