Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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
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.
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.
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.
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.
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 ?
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.