LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-02-2007, 09:28 AM   #31
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53

Quote:
Originally Posted by badboy88
When I insralled Ubuntu 6.06 from scratch on my home desktop I allocared a eight gigabyte swap aperirion even thou I had 1GB off ram because I'm planning to up grade my ram to the motherboards maximum capacity of two gigs of ram but didn't desire a wimpy swapaprtiton.
8Gigs!! Come on. It depends on what you do (video processing,dvd authoring,terminal server...) but 1G-3G swap for 1G RAM is enough for all cases.
 
Old 02-02-2007, 09:50 AM   #32
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,496

Rep: Reputation: 68
I would say a swap file rather then a hard coded partition would probably be a better idea if your going to be using suspend2 because you wont need the space all the time just when you suspend the system. I also think there is a way to change what file suspend uses but I forgot it and I am to lazy to go crawl around on the web looking for it as I have my own issue to resolve
 
Old 02-03-2007, 12:52 PM   #33
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
I'm going to disagree with those who call for a small swap because you won't need it - particularly if you only have 512 Meg and want to run a couple of VMs as well.

I run Mandriva 2007 (using KDE) with 1 Gig RAM, a 1 Gig swap, and I routinely run VMWare Workstation with one or two Windows VMs running. Over time I find that my system is filling the swap and eventually things slow down due to extensive swapping.

Part of the reason for this seems to be related to a memory leak in Mozilla, but there also appear to be other reasons that I don't have completely sorted out as well.

As I write this, my current X session has been running for 38 hours. I have one VM running. All of my RAM is in use, as is 261 Megs of swap. I have 7 Mozilla windows open (one with 4 tabs). I also have KMail upk GAIM, bittorrent, a few monitoring utilities, a few KDE utilities such as Kwallet, an assortment of Konqueror file management windows, and KMPlayer running. The Windows VM is running one of my Windows development environments.

Personally, I need the swap. With half the RAM and the desire to run VMs, you'll need it too, I think.
 
Old 02-03-2007, 07:09 PM   #34
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
And I disagree with the preference of using a swap-file over a
dedicated swap-partition. The file comes with two 'problems':
a) overhead of which-ever file-system you locate it on.
b) potential fragmentation of the swap-file (linux file-
systems are inherently fragmentation-repelling, but they
can't guarantee that a large file won't be split into
chunks).

Both of the above will make swapping significantly slower.



Cheers,
Tink
 
Old 02-03-2007, 07:36 PM   #35
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,486

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
On 2.6 this shouldn't be an issue.
The swap code doesn't use the underlying filesystem - uses the device driver directly.
Been a while since I looked at the code, and I wasn't interested in file based swap I must admit, but I'm pretty sure the code is common.

Forgot: must admit I still prefer partitions too. Each to their own.

Last edited by syg00; 02-03-2007 at 07:46 PM.
 
Old 02-04-2007, 02:48 AM   #36
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by syg00
On 2.6 this shouldn't be an issue.
The swap code doesn't use the underlying filesystem - uses the device driver directly.
Been a while since I looked at the code, and I wasn't interested in file based swap I must admit, but I'm pretty sure the code is common.
That's curious; how does the swap-code know which
inodes/sectors belong to it if it doesn't interact with the
file-system? And no, I don't want to read the code,
it's not that important to me :}

Quote:
Forgot: must admit I still prefer partitions too. Each to their own.
Aye. I may (just for the heck of it) do some testing
with partition and file-based swapping. My knowledge
on this topic may indeed be dusty.



Cheers,
Tink

Last edited by Tinkster; 02-04-2007 at 02:52 AM.
 
Old 02-05-2007, 12:08 PM   #37
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,496

Rep: Reputation: 68
I'm pretty sure that a swap file uses file system overhead. I'm thinking that he is referring to the swap partition instead.


What I do personally on my laptop is have a moderate swap parttion 512mb and I have 1g 256mb of ram. I don't use suspend2 tho as I haven't had much luck in the past getting it to work properly and the suspend to ram works fine for what I use it for. And with regards to a swap file, I probably would only need that if I was going to be doing something special and needed more swap then the 512. More then likely it would be temporary and would not replace the partition. Remember that you can have more then one swap.

As far as overhead goes tho I think that with a sata drives in most systems these days the overhead is minimal compared to a dedicated partition but testing would reveal that.

Ohh and can a SWAP be put on a LVM setup or is that a totally diffrent kind of setup ?

Last edited by exvor; 02-05-2007 at 12:09 PM.
 
Old 02-07-2007, 02:04 AM   #38
digital8doug
Member
 
Registered: Aug 2006
Location: Near Binghamton, NY-the recent FLOOD zone
Distribution: Sabayon 351, Mepis8, oSuse11.3, Kubuntu8.1, Fed10, Slack12.1 #426299 RLU
Posts: 145
Blog Entries: 1

Rep: Reputation: 15
Thumbs up Part vs file: Swap % vs # & size SODIMM RAM. Std app for BM results. PC clone vs MbP

Thanks for all the info, I actually understand the concepts in some of it. Would be very interested in how the swap file vs the SWAP partition result turns out in recent releases (>2.6 kernels)!
How important is the # of DIMM filled & size of the SODIMM RAM vs % swap [swap =1xRAM, vs swap=2xRAM etc].
What about real world SWAP applications of AMD x2 Turion vs C2D? (or Pentium M on i915 vs C2d on i945?).
Any standard application in GNU/Linux for evaluating BM results; few Large MB vs ## KB files?
Quote:
Originally Posted by Tinkster
SNPD/EDTD how does the swap-code know which inodes/sectors belong to it if it doesn't interact with the file-system?
As still learning, I don't know how to read the code. How important is knowing how to do that for someone interested in tweaking machine setup for best DVE performance?
Quote:
I may (just for the heck of it) do some testing with partition and file-based swapping.
Aye matey! If I knew how to do it, I may try it on my sig machine. And then again on a similar HD {ST910021AS} but with a CD cpu in a MbP MA611, when/if I ever get GNU/Linux {oSUSE, FC} running virtually with Parallels.
On my PC clone I could also test how SWAP vs swap on 150x 2 &/or 4 GB SD cards, or USB flash memory drives affects system.
 
Old 02-07-2007, 07:34 AM   #39
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53
You can also put the SWAP in RAM via a ramdisk.

So.. who does the test Partition vs File?
On recent kernels.

Swap partition can also have fragmentation problems, just like swap file.
 
Old 02-07-2007, 01:54 PM   #40
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,496

Rep: Reputation: 68
Quote:
You can also put the SWAP in RAM via a ramdisk.
That would kind of defeat the purpose of swap



Quote:
Swap partition can also have fragmentation problems, just like swap file
I thought the swap file system gets recreated every time the system boots if so then fragmentation would not be an issue.

But I am not sure.....
 
Old 02-07-2007, 01:57 PM   #41
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53
Quote:
Originally Posted by exvor
That would kind of defeat the purpose of swap
swap is an additionnal memory that you need. Putting a small portion in ram is an option which is supposed to be quick. All this is theorical, I never tried or timed anything.
I admit its a bit weird


Quote:
I thought the swap file system gets recreated every time the system boots if so then fragmentation would not be an issue.
You do reboot?
Quote:
6:26pm up 76 days, 9:27, 13 users, load average: 0.25, 0.14, 0.07

Last edited by nx5000; 02-07-2007 at 01:59 PM.
 
Old 02-07-2007, 05:17 PM   #42
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,496

Rep: Reputation: 68
Considering this is supposed to be on a laptop I would hope that they reboot often then again maybe not
 
Old 02-07-2007, 06:12 PM   #43
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by nx5000
Swap partition can also have fragmentation problems, just like swap file.
Even if that were the case (I haven't spent much thought on
it but admit that the behaviour of paging memory in and out at
varied points in time may lead to that result) having swap in
a file on an ordinary file-system would make the issue bigger
by multitudes because the fragmented swap-space (spread in the
file-system) would suffer the same issue as a swap partition.
Scattered scatter.



Cheers,
Tink
 
Old 02-08-2007, 09:18 AM   #44
inspiron_Droid
Member
 
Registered: Dec 2006
Distribution: Debian (Wheeze)
Posts: 391

Rep: Reputation: Disabled
Quote:
Originally Posted by nx5000
8Gigs!! Come on. It depends on what you do (video processing,dvd authoring,terminal server...) but 1G-3G swap for 1G RAM is enough for all cases.
The reason I have such a big swap partiton is because I use Cross over office to rum=n MS Office due to the fact that I need compatibility with ms offive for diong homework. and aslo to run n64 emulators that don't as of yet have linux versions released.
 
  


Reply

Tags
laptop, memory, 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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
laptop freezing up, swap disabled? ehawk Linux - Hardware 0 10-04-2004 04:27 PM
Swap-out cd/floppy drive on laptop. acratus Slackware - Installation 4 07-24-2004 03:02 PM
Mandrake 10.0 Laptop Won't Boot Past "Activating Swap Partitions"? Aaron Josephson Linux - Software 0 06-26-2004 09:02 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 08:58 PM


All times are GMT -5. The time now is 02:39 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration