Lazy Swapping in Operating System Last Updated : 07 Mar, 2023 Comments Improve Suggest changes Like Article Like Report Pre-requisites: Swapping in Operating System Lazy swapping, also known as demand paging, is a memory management technique used in operating systems to allow programs to access more memory than is physically available in the system. Increasing the degree of multi-programming of the system means increasing the number of processes loaded into the RAM (Random Access Memory). The concept of virtual memory comes into the picture. In the system that used the lazy swapping technique, the whole process program is not loaded into the RAM but only the portion of a program is loaded. One part of the program is loaded into the RAM. when that portion is needed when the loaded program tries to access the data which is currently not loaded into the RAM. Because of it, the memory requirement is less than the whole program and so other processes can be loaded into the RAM and can run simultaneously, even total memory requirements of all program is greater than the physical memory available in the system. The operating system manages the swapping of data in and out of the memory as needed so that the user does not experience a delay in the process. However, lazy swapping can result in slower program execution times due to the time, because of time taken by swapping to swap data in and out of memory. If the demand for memory is greater than the amount available, the system may need to use a portion of the hard drive as virtual memory, then further program execution will slow down. In the above diagram, Process 1 has pages P11, P12 on the RAM, and, Process 2 has pages P21, and P22. If page P12 is not required further to execute Process 1 then it is swapped out from RAM. Similarly for Process 2, if it needs a Page P21 then and then only that page will be loaded into the RAM. In conclusion, Lazy Swapping is a technique used in Operating Systems to manage virtual memory and improve system performance. It does not load the pages to the swap file until it is necessary and reduces the number of disk I/O operations required. Lazy Swapping can help the system to not run out of physical memory and it maintains good performance of the system. Comment More infoAdvertise with us Next Article Lazy Swapping in Operating System abhishekaslk Follow Improve Article Tags : Operating Systems Operating Systems-Memory Management Similar Reads Swapping in Operating System To increase CPU utilization in multiprogramming, a memory management scheme known as swapping can be used. Swapping is the process of bringing a process into memory and then temporarily copying it to the disc after it has run for a while. The purpose of swapping in an operating system is to access d 5 min read Spooling in Operating System In the Operating System, we had to provide input to the CPU, which then executed the instructions and returned the output. However, there was a flaw in this strategy. In a typical situation, we must deal with numerous processes, and we know that the time spent on I/O operations is very large in comp 4 min read Prepaging in Operating System Prerequisite â Virtual Memory in Operating System As suggested by the concept of virtual memory, it is not necessary that the entire process should be loaded into the main memory at the given time. The process can be executed efficiently if only some of the pages are present in the main memory at a 4 min read Paging in Operating System Paging is the process of moving parts of a program, called pages, from secondary storage (like a hard drive) into the main memory (RAM). The main idea behind paging is to break a program into smaller fixed-size blocks called pages.To keep track of where each page is stored in memory, the operating s 8 min read I/O scheduling in Operating Systems Input/Output (I/O) operations are how a computer communicates with external devices such as hard drives, keyboards, printers, and network interfaces. These operations involve transferring data into and out of the system whether itâs reading a file, saving a document, printing, or sending data over a 6 min read Context Switching in Operating System Context Switching in an operating system is a critical function that allows the CPU to efficiently manage multiple processes. By saving the state of a currently active process and loading the state of another, the system can handle various tasks simultaneously without losing progress. This switching 4 min read Starvation and Aging in Operating Systems Starvation occurs when a process in the OS runs out of resources because other processes are using it. This is a problem with resource management while Operating systems employ aging as a scheduling approach to keep them from starving. It is one of the most common scheduling algorithms in batch syst 6 min read Swap-Space Management in Operating system Swapping is a memory management technique used in multi-programming to increase the number of processes sharing the CPU. It is a technique of removing a process from the main memory and storing it into secondary memory, and then bringing it back into the main memory for continued execution. This act 6 min read Multi Processing Operating System The operating system functions like a manager of all the available resources. Therefore operating system is defined as an interface between the system and the user. There are various types of operating systems such as Batch Operating Systems, Multi-programming Operating Systems, distributed operatin 4 min read Memory Protection in Operating Systems In this article, we will be discussing memory protection in operating systems. As we know that different operating systems use different forms of memory protection or separation which consists of Plan9 and Inferno, Microsoft Windows, etc. In Memory protection, we have to protect the operating system 5 min read Like