What is swap

Closed
jagan jay - Jul 8, 2009 at 10:36 AM
Tom6 Posts 142 Registration date Friday July 31, 2009 Status Member Last seen August 7, 2009 - Aug 1, 2009 at 10:06 AM
Hello,
what is swap in solaris os in partition time

1 response

Tom6 Posts 142 Registration date Friday July 31, 2009 Status Member Last seen August 7, 2009 16
Aug 1, 2009 at 10:06 AM
https://help.ubuntu.com/community/SwapFaq

The simple answer is that swap is a temporary storage space used by ram and used to cache data ahead of when it's needed. For example if you are watching a movie then what you see right now is being processed by the cpu and gpu on your graphics card, what is due to immediately follow is queued up (cached) in ram and what follows from that is cached in swap. If the cpu/gpu had to wait to read the data directly of the hard-drive, or even worse the cd/dvd-player then you'd be watching some horrible flickering slow-motion. Ram is extremely fast and handles the swap well. Also when you use sleep/suspend/hibernate modes the contents of ram get copied into swap so that when the power goes off the contents of ram aren't lost. Swap is carefully kept as a fixed size so that it doesn't get defragmented because that would seriously slow your machines performance.

Windows also has swap but it uses a file rather than a separate partition and of course Windows defragmenters cant defrag it because it's a system file. This is one main reason why Windows slows down so badly. The file is called pagefile.sys" in Windows.

Sorry that all got a bit intense. the main thing to note is that swap should be between equal to Ram size (otherwise hibernate/sleep/suspend is triky) and 2xRam but more than that is a waste of space because of the efficiency of linux in dealing with swap space ;)

I hope this helps!
Good luck and regards from
Tom :)
0