Swapping in OS is one of those schemes which fulfill the goal of maximum utilization of CPU and memory management by swapping in and swapping out processes from the main memory. Swap in removes the process from hard drive(secondary memory) and swap out removes the process from RAM(main memory).
In this article we will be learning about the following topics:
There are two important concepts in the process of swapping which are as follows:
Swap Out:
It is a method of bringing out a process from the main memory(RAM) and sending it to the secondary memory(hard drive) so that the processes with higher priority or more memory consumption will be executed is known as the Swap Out method.
Note:- Swap In and Swap Out method is done by Medium Term Scheduler(MTS).
Advantages of Swapping in OS
The advantages of the swapping method are listed as follows:
Disadvantages of Swapping in OS
There are some limited disadvantages of the swapping method which are listed as follows:
Example:
Let's understand the concept of swapping with an example:
process size of the user is 4096Kb
the transfer rate of data is 4Mbps
Now,
4 Mbps is equal to 4096 kbps
Time taken to transfer the data = process size of user/ transfer rate of data
Now, coming to the Calculation part:
Time Taken = 4096 / 4096
= 1 second
= 1000 milliseconds
Now, taking both swap in and swap out time into account the total time taken for transferring the data from main memory to secondary memory is equal to 2000 milliseconds which is 2 Seconds.
Conclusion
10 videos|99 docs|33 tests
|
|
Explore Courses for Computer Science Engineering (CSE) exam
|