What is Swapping?

Swapping :

  • This is a memory management technique.Swapping makes it possible for the total physical address space of all processes to exceed the real physical memory of the system, thus increasing the degree of multi-programming in a system.
  • Swapping is the procedure of moving out the entire process(its address space) from main memory to some sort of secondary storage(typically hard disk or tape storage) or any other fast storage large enough for the current needs.
  • Operating System typically maintains a ready queue of processes. The queue comprises of information about processes that are ready for the execution in memory. However, the images of these processes can either be in memory or on disk (in which case it needs to be loaded into memory off the disk). If the process that is to be scheduled next is on disk, and there is no free space in main memory, a process that is currently resident in memory is swapped back to disk. The process that is to be executed next can then be loaded into memory and allocated space for its data segment, text segment etc.
  • The most important thing to note here is that the complete process is swapped in/out.
  • There is no granularity over here as to what part of process’s address space is swapped back to disk. The complete process image in its entirety is swapped back to disk.

Leave a Reply

Your email address will not be published. Required fields are marked *