You are not logged in.

#26 2006-12-15 23:58:02

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: Swap = 2 x RAM

pauldonnelly wrote:

!!

I don't know what kind of RAM the big DEs want, but I can't imagine what kind of lightweight box would want 1-1.5 GB. My fairly lightweight systems with 512 MB RAM hardly ever touch swap at all.

By "lightweight", I meant a typical Fluxbox/Openbox (or whatever) setup that does the duties of a full desktop. Multimedia tasks (video encoding, for example), image editing, and large compiles can take a lot of memory. If you only do web/office tasks or simple development, you can use a lot less.

Offline

#27 2006-12-17 22:16:42

deficite
Member
From: Augusta, GA
Registered: 2005-06-02
Posts: 693

Re: Swap = 2 x RAM

I have 768MB of RAM and 256MB of swap. I'd like to go to >1GB soon, but I'll still keep just 256MB of swap.

Offline

#28 2006-12-19 12:41:56

fluke
Member
From: Shaoguan Univ., PRC
Registered: 2005-08-12
Posts: 241
Website

Re: Swap = 2 x RAM

It depends on how you use your computer in my opinion.

I have 512M RAM, normally about 0-100M swap space is used, but sometime when I run vmware and many other applications, they eat up more than 512M swap.

Offline

#29 2006-12-19 19:35:06

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Swap = 2 x RAM

As I started this thread I'll let you all know what I decided.  I did what Con K suggested.  He knows much more about it than me and so I consider his suggestion gospel i.e. 256 MB is plenty.

As for vmware eating swap: I'd have to argue that if you are using that much swap you don't have enough RAM to do what you are doing tongue

Offline

#30 2006-12-21 06:48:24

PingFloyd
Member
Registered: 2006-08-19
Posts: 25

Re: Swap = 2 x RAM

The thing about swap size is that general rules of thumb are just that -- general rules of thumb that may or may not  apply to who knows how many number of people (everything really is situational).  The real answer to what size to have as swap is -- the right size for swap is dependant upon how much ram the system is going to require under it's largest loads. 

For instance, there are times that my system isn't even using swap, while at other times I require a considerable amount.

I used to keep a swap partition of 1G, but found over time that my swap usage never went over 200MB.  So I use a 256MB swap partition nowadays and it seems to be more than enough.  I like to not have my swap partition any bigger than needed because I locate it to the outter cylinders (better the transfer rate the farther out the tracks, that are being accessed, are, except with certain drives.).  Of course, if you're using the swap partition on the same drive as partitions containing files that need to be accessed alot, then it can sometimes be better to locate the swap partition near the middle cylinders so that head travel is lessenned as they read back and forth between the different areas simultaneously (shaves cumulative latency off).  However, my prefered approach is the have the swap parition as the first partition on an HD that is different than the system that will be making use of it. 

When all is said and done though, the differences of swap placement are almost negligable when you get right down to it.  Never really enough to make a very big difference in most situations.  Still, regardless of optimization strategies, I still like to not have a swap partition any larger than it really needs to be since it's just a waste to.  I can always find other uses for any space that I can manage to free up.

And just for point of reference, I use gnome and tend to keep alot of resource hungy programs open at a time like firefox (usually about 5-6 tabs going), compiling stuff in the background, and sometimes OOO running.  Even then, it seems like it's got some space left in swap to grow.  And this is on a 128MB DRAM system.

Offline

#31 2006-12-21 09:32:16

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: Swap = 2 x RAM

I'm old fashioned and go with the 2xRAM for swap.  But when you have over 1TB of hard drive space, 4G swap partition isn't gonna ruin my day that much wink


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#32 2006-12-21 12:41:43

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Swap = 2 x RAM

Hmm, yeah, I guess if you have that much storage who cares if you waste it...but then why pay for what you don't need?

Offline

#33 2006-12-21 14:53:35

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: Swap = 2 x RAM

dtw wrote:

Hmm, yeah, I guess if you have that much storage who cares if you waste it...but then why pay for what you don't need?

Each time I upgrade my drives (doesn't happen that often really), I end up thinking "But it's only a couple of pounds more for the next size up...".  After a while, I finally decide it's getting rediculous and settle for an oversized drive for a moderate price.  Also, I have 260G of vids and music, and want somewhere to back them up, thus I have 2 320GB drives wink


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#34 2006-12-21 15:12:59

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Swap = 2 x RAM

2x320=640?  Is that a TB?  While the actually definition might be confused (I thought it was 1,024 GB) I'm pretty sure that's more like 1/2 a TB :-)

Offline

#35 2006-12-21 22:17:52

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Swap = 2 x RAM

2x160GB Maxtor DiamondMax 10, 2x320GB WD
That adds up to 960GB smile

I currently have 1GB swap for all my boxes, altho it is newer used, exept for my thinkpad where I use it for suspending. (It has 700andsomething MB ram)
You don't realy notice 1Gb of diskspace, when the laptop, who has the least storage, has a 80GB drive.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#36 2006-12-22 15:18:22

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: Swap = 2 x RAM

dtw wrote:

2x320=640?  Is that a TB?  While the actually definition might be confused (I thought it was 1,024 GB) I'm pretty sure that's more like 1/2 a TB :-)

(2x320)+(2x160)+(2x80)=1120GB.


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#37 2006-12-22 20:45:00

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: Swap = 2 x RAM

I have 2GB of RAM and also 2GB of swap...I don't think I've ever touched the swap, but my reasoning for having it that size was for if I ever needed suspend or hibernation, won't the swap have to be at least the same size as the RAM to dump it all?  Or can you configure it to dump to a file instead of the swap?  If that's true, I'd probably drop it down to 512MB or so if I ever have the urge to reformat...

Offline

#38 2006-12-22 21:19:48

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: Swap = 2 x RAM

I have 40 EiB


/kidding/

I have 80 gigs on my lappy, and ~500 gigs on a desktop that is MIA.  Which is sad,  I need to resurrect it or something, such a waste.

elasticdog wrote:

[...]won't the swap have to be at least the same size as the RAM to dump it all?[...]

Basically.  I've never tried suspending with all my RAM in usage, but I do the same thing.  And yes you can do what's called "filewriter" and you just tell it where to start writing on your fs.

Offline

#39 2006-12-23 06:35:24

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: Swap = 2 x RAM

elasticdog wrote:

won't the swap have to be at least the same size as the RAM to dump it all?

Ideally swap should be bigger than RAM.  If your car was the exact size of a parking space, would you try and squeeze it in there somehow....?

elasticdog wrote:

Or can you configure it to dump to a file instead of the swap?

Filewriter.


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#40 2006-12-23 13:09:48

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Swap = 2 x RAM

chrismortimore wrote:
elasticdog wrote:

won't the swap have to be at least the same size as the RAM to dump it all?

Ideally swap should be bigger than RAM.  If your car was the exact size of a parking space, would you try and squeeze it in there somehow....?

elasticdog wrote:

Or can you configure it to dump to a file instead of the swap?

Filewriter.

Suspend2 at least, offers different forms of compression. It also flushes caches and dumps just the ram you're using, so 1:1 is normally plenty of space for a swap partition.

James

Offline

#41 2006-12-30 00:56:27

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: Swap = 2 x RAM


to live is to die

Offline

#42 2007-01-07 23:24:26

RedShift
Member
From: Belgium
Registered: 2004-07-16
Posts: 230

Re: Swap = 2 x RAM

If your system starts to swap you really need some extra RAM.


:?

Offline

#43 2007-01-09 14:50:42

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: Swap = 2 x RAM

RedShift wrote:

If your system starts to swap you really need some extra RAM.

In most cases. But for some tasks you need more than 2 GBs.
And swap is much cheaper than RAM.
There's no need to keep 2-4 GBs of RAM which will be fully used only occasionaly.
1 GB of RAM is more than enough for most dayly uses.
If user is never going to do some memory-hungry tasks, then having something 1 GB of RAM and 256 MB cache is ...ehm, why is it for?

I saw my swap was used only once on my home machine with 1 GB RAM.


to live is to die

Offline

#44 2007-01-18 12:02:04

Raniz
Member
From: Lund, Sweden
Registered: 2007-01-11
Posts: 14

Re: Swap = 2 x RAM

skymt wrote:

Ironically, the more RAM you have, the less swap you need. A much better guideline is to pick a number based on how much memory you think you'll need (frequently 2G on a modern KDE/Gnome desktop, 1-1.5 G on a lightweight box), add a bit (just in case), then subtract your current RAM.

I don't know what you've based those numbers on...

I currently run twin X-servers (one on my TFT and one of my TV) both running KDE with Enlightenment as WM.

On my first Xserver I've got Konqueror, Kontact, PSI, 2xKonsole, Amarok, LinuxDC++, Superkaramba and a couple of KDE-deamons.
On the second one Kaffeine is playing fullscreen video.
Also, I've got a couple of system daemons running.

All this uses 60% of my 512MB RAM and 1% of my ~500MB Swap. That adds up to ~360MB total memory usage.

And as for you who say that something is wrong when the system starts to swap you should read a little about what the kernel uses swapspace for.
Sure, the kernel uses the swap when it runs out of RAM, but it also uses the swap to free up space for buffering and caching when an application hasn't used it's memory for some time.

That's what the swappines setting is for, helping the kernel determine when an applications memory should be swapped out to free up space for buffers and cache. The higher the value, the more memory the kernel will swap out.

Of course it's great if you have so much memory so the kernel doesn't need to free up space for buffers and cache, but for us normal people with normal computers, the swap is still a great thing and it should not be considered a bad thing if the kernel starts to swap out some memory, unless it's doing it because the RAM is full.

And lastly, I'll give my insights in how much Swap you'll need. If you plan to use suspend to disk you should at least have as much swap as RAM.
But if you don't, you'll easily get away with some hundred megs. 500 should be enough for a normal desktop computer, regardless of how much RAM you've got.

Offline

Board footer

Powered by FluxBB