Re: Disk Space Low?



Jaime wrote:
Years back, the conventional wisdom was that setting the swap to more than 2x your physical RAM was pointless. The swap file doesn't actually replace/add to the RAM as a dynamic workspace for the computer, it only functions as a holding area.

If the RAM is filled (because you have a memory intensive app running, opened a large doc, whatever) and you now want to open another doc, the computer swaps the data in RAM to the hard drive so it can work on the new stuff. When you switch back to the other program, doc, etc., the computer swaps the new doc to the drive and puts the other stuff back into RAM. In theory, in a maxed-out situation, you would need 2x RAM in the swap; half to hold the data being held, half for the data to be written (since that has to occur before it can grab the old stuff and put it back into RAM). In the real world that would never happen, because some of the bits in RAM are never going to be swapped out (system stuff, background apps, etc.), the number of 1.5 times is probably a realistic sweet spots. That said, I still used to set mine to twice the RAM -- figured couldn't hurt and drive space is cheap.

So adding more swap to a low-RAM PC isn't magically make it run like it has more RAM. Adding more RAM is always better, all that reading and writing to the drive is not as efficient as reading and writing to RAM.

I'd go one step further--if you are actually using your swap space (a
lot of swap disk I/Os)--then you are slowing your machine down to a
small fraction of its "flat out" speed.

Virtual memory is only a good idea if you aren't actually using it. ;-)
Get more RAM until swapping becomes rare or stops altogether.

-michael

Home page: http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it is seriously underused."
.



Relevant Pages

  • Re: New first time install
    ... And Windows has no hope reading or writing to Linux file ... > how you use the system, so it's hard to tell how much swap you will need. ... > I would use at least 256 MB, and up to twice the physical RAM if I thought ...
    (alt.os.linux.suse)
  • Re: 32 bit application on 64 bit os
    ... say example reading and writng strings with RAM? ... When i run both applications one by one(basically reading and writing ... Because you're waiting for the very same hard disk that always works ...
    (comp.os.linux.development.system)
  • Re: excessive swap-in time
    ... Trying to do it all with RAM is just inefficient. ... I find that does not work well when the swapping is caused by excessive I/O ... Or you could have 5 TB of swap space. ...
    (comp.os.linux.development.system)
  • SLUB 0:1 SLAB (OOM during massive parallel kernel builds)
    ... 2G of RAM, 1G of swap partition. ... DMA per-cpu: ... kill process 25286 score 188662 or a child ...
    (Linux-Kernel)
  • fork failed cannot allocate memory
    ... I have a Dell 2650, dual Xeon box, 2GB RAM, 6GB swap with PERC Hardware ... feeding the perl processes). ... Every week or two the box will stop allowing new netcool client ...
    (RedHat)

Quantcast