I have always used the rule of thumb to make SWAP double the size of the amount of memory you have. This was in the days when 512MB of memory was considered a lot. In fact my SWAP partition on my desktop is 2GB since I have 1GB of memory.
So my question is my laptop has 4GB of memory, which is a lot. Would it be wise to make a 8GB SWAP partition? It sounds really big to me. What rule of thumb should I follow now?
Thanks.
-
The Fire Snake Notebook Virtuoso
-
i had same question long ago... a teacher of OS told me that for 2gb it was practically unnecessary to add the swap...
do the maths -
I usually let windows manage mine.
-
-
1-2 gigs.
(10char) -
My opinion (what else), which is mirrored in Ubuntu's Swap Partition FAQ, is that not only should you definitely have a swap partition, but that it should be, at the minimum, equal to the amount of RAM you have installed, for systems where you have at least 2gb of RAM. The main reason for that is that even though you may have enough RAM where your system will likely not need to swap to disk, if you want to hibernate, you will need a swap partition as big as your RAM. If you have less than 2gb of RAM installed, then my recommendation would be that you can use the old rule of thumb of twice the amount of RAM installed.
Good Luck.. -
I have 2GB of RAM in my ThinkPad T42 and I have set the kernel to not swap at all (swappiness=0). The system is just as stable with no performance hit whatsoever. -
2 gigs.....is what I have. My system ram is 3 gigs, and it uses swap on large file transfers to my external HD.
-
256MB to 1GB is suffeciant for me.
-
I don't have one, but then again I have 2GB of ram and never suspend or hibernate.
-
I have 4gb RAM and made the swap file partition to 4gb
-
If you compress the image when you hibernate, you only need 1/2 the RAM. For pure swap usage, with 4GB, I'd use no swap, but no more than 512MB for normal desktop use. On the other hand, for some uses 4GB might not be much memory, so you need more swap.
-
I always have swap=RAM. That's since I have 2Gb. Then again, I don't really see a reason to have 4Gb of RAM. Most computers hardly use over 2Gb in the first place.
But for RAM <2Gb, I'd recommend 2 times the swap.
Swap size is only really important if you Hibernate or Standby often. Because the data, in these cases, are saved into the swap, not RAM. -
In the age of big and cheap RAM, the only purpose of SWAP is to let you hibernate your laptop . So, you need SWAP partition of the size slightly bigger than your RAM.
-
-
-
The Fire Snake Notebook Virtuoso
Ok, thanks for all the replys. I am still confused though. I will definitely have some swap space. So it looks like, from your comments, that I will need a swap space equal to or slightly larger than my RAM if I want to hibernate.
So basically I can get away with 2 GB of SWAP space if I don't Hibernate?
What about if I want to put the laptop to sleep, how big of a swap space is needed?
What happens if you run out of swap space, major crash?
-
I have 1 gig of ram, and I've never had to use swap space, even while running a resource-heavy DE. So yes, you could get away with using less swap than your ram if you never Hibernate.
I don't think you will need any swap space to go into Sleep Mode (a.k.a Standby or Suspend to RAM); you have more than enough RAM.
Before you can run out of swap, you first have to run out of ram, and I can't imagine your doing anything with linux that will require more than 2 gigs of ram (barring major hypervisoring); so you shouldn't be worried. -
The Fire Snake Notebook Virtuoso
Ok, Thanks to all for the great input!
So here is what I have decided(not sure if it would help others in the same dilemma)
I will be putting Kubuntu 8.04 on my Thinkpad T61p in the next couple of days. I am going to probably use 1 GB of SWAP space. I want to use some, just to be safe. Since I have 4GB of RAM I don't think I will use swap space much for normal tasks(not going to do much intensive work) and even if I use some SWAP I will have 1GB.
I went to thinkwiki and found out that hibernate doesn't even work in Ubuntu 8.04, so I won't use that then and I don't need the 4+ GB of SWAP space for that. I will use sleep one in a while, and since that saves to RAM I should be fine. -
depend on the purpose, 512 i stick to. my server has 1gb ram, and i don't see it needs 2gb swap, so 512 is just in case it needs it.
-
Yeah. With 4Gb of RAM, you only need, if you don't hibernate, probably 512 or even 256Mb RAM. You system will very very very very rarely even hit 3Gb RAM in the first place.
-
The Fire Snake Notebook Virtuoso
-
Yeap. I have the 64-bit version. I've not even hit my max of 2Gb yet.
-
I have 2 Gigs RAM and I've set my swap partition to 512 MB, just i case I need to use it (never used more than 32 MB till date). I never hibernate and I've set the swappiness to 0 (someone else has mentioned this before). This controls how often the swap file should be used, and 0 basically means never. And this is running ubuntu 64-bit.
-
-
The only reason you would want swap is if you had some heavy-weight apps that you used. I have 3GB of RAM in my T61, and I also have 3GB of swap. Of that, while running some serious enterprise-level Java data processing apps, and opening and parsing a 90MB XML file, I have used 280MB of my swap. After closing the apps, I have 1.5GB of free RAM. If you want swap at a later date, or even just temporarily for a big job, you can just create a big file, and use it for swap. Or even just plug in a USB thumb drive and use THAT as swap. Try "man swapon" at a console. You can rearrange your swap usage on the fly. -
The Fire Snake Notebook Virtuoso
+1 rep -
I have hibernate with my T61p..
-
The Fire Snake Notebook Virtuoso
-
That's probably outdated data. When it comes to wikis, you shouldn't believe anything that comes from a single source. I'm almost certain that I've seen the T61 under the compatibility list for uswsusp.
Also, the T61 is linux certified under Novell, and Red Hat also I believe. -
My T61 will hibernate (Kubuntu 8.04, 64bit, 3GB RAM). It does some funky graphical stuff when waking back up, and I generally just don't do it because it takes about as long to hibernate as it does to just boot normally. But it does work.
The Age old question: How big to make my SWAP partition?
Discussion in 'Linux Compatibility and Software' started by The Fire Snake, Aug 5, 2008.