LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-01-2007, 12:32 PM   #1
warun
Member
 
Registered: Aug 2007
Posts: 39

Rep: Reputation: 15
swap space


hi,
Is there any hard n fast rule that the swap space should be twice the RAM capacity???

Thanks in advance
 
Old 11-01-2007, 12:42 PM   #2
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
No! That was way back when you had a few MB of RAM. If you have 1GB or 2, your swapspace will probably not be used, but it is nice to have anyways. 512MB would be more then enough, and if you're short on space, 256 would probably work just fine. Personally I have used linux for a while without swap at all, and I diddn't have any trubble. Now I have 512MB and that seems to be a normal choice.

Last edited by Dinithion; 11-01-2007 at 12:44 PM.
 
Old 11-01-2007, 01:26 PM   #3
Nemesiz
Member
 
Registered: Oct 2007
Posts: 47

Rep: Reputation: 2
Like Windows use more then double virtual memory. If you have 256 mb of RAM then virtual memory is set to use between 768-1536 mb of HDD space.
 
Old 11-01-2007, 01:56 PM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
2 x RAM is the MAXIMUM recommended swap space. You usually don't need so much unless you edit large images or movies, in which case you might need it.
 
Old 11-01-2007, 02:00 PM   #5
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
I know that was the traditional logic, but I can't see why I should waste 4GB of my harddrive to "unused" swap?
 
Old 11-01-2007, 02:30 PM   #6
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.2
Posts: 1,180
Blog Entries: 29

Rep: Reputation: 135Reputation: 135
Hi all,

I've wondered about this too. From the monitors I use, it seems that rarely is more than 90% of my RAM used, and my swap partition has never been used.

This is on a Pentium III-800 with 384 MB of RAM running Slackware 11. Granted, I haven't yet edited 70 MB TIFF images, or encoded a DVD-worth of data -- both activities that might use my swap partition. But last night I compiled Scribus, which took almost two hours and used nearly 100% of my processor, and ran Firefox, Pan, Seamonkey, and Emacs at the same time. Things slowed down a little bit, but my swap partition stayed unused.

Is Slackware simply that efficient?

Regards,

-Drew
 
Old 11-01-2007, 02:43 PM   #7
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Typically my swap is not used. But, it is used actively when I open or edit large images or movies ... it doesn't happen too often, but it does happen.
 
Old 11-01-2007, 04:49 PM   #8
Nemesiz
Member
 
Registered: Oct 2007
Posts: 47

Rep: Reputation: 2
If you have enough RAM you can leave swap small.

Like mine:

Mem: 2075008k total, 2016316k used, 58692k free, 82696k buffers
Swap: 0k total, 0k used, 0k free, 1296012k cached

WTF?! Swap zero ? Oh yes now i remember. HAL has destroyed my /etc/fstab few days ago and all this time i was without swap

Mem: 2075008k total, 1652772k used, 422236k free, 57884k buffers
Swap: 2008104k total, 32880k used, 1975224k free, 1276620k cached

Oh, now its fine.

Last edited by Nemesiz; 11-01-2007 at 05:09 PM.
 
Old 11-01-2007, 06:07 PM   #9
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
HAL does not destroy your fstab file, it does not write to it at all.

Eric
 
Old 11-03-2007, 12:34 PM   #10
Nemesiz
Member
 
Registered: Oct 2007
Posts: 47

Rep: Reputation: 2
Quote:
Originally Posted by Alien Bob View Post
HAL does not destroy your fstab file, it does not write to it at all.

Eric
Well thats happened after i pluged external HDD and my all /etc/fstab was modificated. HAL was running then. External HDD had etx3 and vfat partitions
 
Old 11-04-2007, 07:42 AM   #11
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
HAL shouldn't be able to even touch your fstab, even if by some weirdness it wants to screw with it imho,...
Quote:
bash-3.1$ ll /etc/fstab
-rw-r--r-- 1 root root 1.2K 2007-10-27 14:28 /etc/fstab


To the op, swap space is generally not needed if you have >1GB ram (even in 512MB , but ymmv).

BUT, 2.6.23 kernel supports suspend to disk (Hibernate in windows speak) and so it would be nice if you keep >500MB space as swap so that you can use that feature painlessly.
 
Old 11-04-2007, 09:15 AM   #12
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by Nemesiz View Post
Well thats happened after i pluged external HDD and my all /etc/fstab was modificated. HAL was running then. External HDD had etx3 and vfat partitions
If that happened, you have installed some 3rd party software afterwards, because the standard software in Slackware 12.0 does not mess with your fstab file if you plug in a piece of hardware.

Eric
 
Old 11-04-2007, 11:11 AM   #13
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
My laptop uses quite a bit of swap space. I have 512M memory and 1G of swap. Currently, according to free, it is using 504M of memory (of which 250 is buffers and cache) and 291M of swap. I tune swapiness to 15. I _do_ tend to have a lot of programs running at any given time. Top memory contenders are openoffice and firefox, both of which I usually have open all the time, then X+kwin, then thunderbird and the 4 terminals I have open. And I currently don't have any large image files open, but it would not be unusual. I also very rarely re-boot the machine since I use sleep and hibernation.

I plan to get more memory for this machine (although it is not usually sluggish), but even so I think I'll want swap space.

Another reason to consider swap space is if you plan to use hibernation to swap. I don't know what the calculation is for that.

Brian

Anyway,
 
Old 11-04-2007, 01:35 PM   #14
globaltree
Member
 
Registered: Oct 2007
Location: Oregon
Distribution: Slackware 12.2
Posts: 65

Rep: Reputation: 18
swap seldom needed with lots of physical ram

If you have lots of physical RAM already then why even use swap? That's 4 GB of good storage you can still use.

I only have 256MB of ram in my mac mini, and so I created a 512MB swap partition (of which it hasn't used over the first 128MB yet). But if I had 2 GB physical storage, I wouldn't bother with the swap.

I'm not sure about this, but it seems like using swap partition can create an imperceptible greater wear-and-tear on drive, as well as greater energy consumption, as the heads have to do more work moving to and fro from the swap partition, and I think head movement is the slowest and noisiest part of a drive's operation.

I guess my question to those more advanced concerning this would be: could using a swap partition actually lower the lifespan of a drive?

If so, then I think the logic is that it is worth the extra wear-and-tear on the drive, and the shortened lifespan,and the increased little whirring sounds, to use swap, in low physical memory situations, since it delivers a performance boost. But in high physical memory situations, it might not be worth the trade. Of course, in high physical memory situations, the swap is seldom used, so this wear-and-tear is not occurring. I think it just depends on how memory intensive your tasks are: if you are rasterizing a hundred images at once, maybe it could still boost performance, but otherwise what your are really sacrificing is just an unused portion of your drive, as you correctly surmised.

Last edited by globaltree; 11-04-2007 at 01:37 PM. Reason: can't psell
 
Old 11-04-2007, 02:01 PM   #15
Nemesiz
Member
 
Registered: Oct 2007
Posts: 47

Rep: Reputation: 2
Quote:
Originally Posted by Alien Bob View Post
If that happened, you have installed some 3rd party software afterwards, because the standard software in Slackware 12.0 does not mess with your fstab file if you plug in a piece of hardware.

Eric

Maybe. But i have installed only opera who are not in Slackware 12.0. Everything else are installed from CD.

p.s. i still thinking that HAL is responsible for /etc/fstab and btw i`m allways using root account for X and others programs. So i just made chattr +iu /etc/fstab
 
  


Reply



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
how to reduce swap space and reclaim the space grantm Linux - Newbie 7 08-16-2012 07:05 AM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 03:20 AM
Swap space not being used?! superchar42 Slackware 18 02-12-2005 12:50 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM
Swap space naren Linux - Software 2 03-24-2004 02:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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