In a computer, one of the most demanded resources apart from the central processing unit is the system memory. The system memory houses the code, stack, heap, and data variables of each process that runs in it. The memory manager is the part of the operating system that allocates the system memory to all processes. In a time-sharing operating system, the system memory needs to be shared among multiple processes. For this reason, there may be times when there isn’t enough physical memory, and some chunks of data have to be swapped between the secondary storage and the main memory (Krzyzanowski).
In paged memory management, the primary memory is divided into fixed size units known as page frames and the running process’ virtual address space into same size pages. The process of managing these pages needs to be fair because of demand-paging, which requires the system to move pages between the primary and secondary memory. During demand paging, pages are only brought into memory when the executing process requires them. For a page to be brought into the memory, its process execution must have higher priority than other processes for it to be moved in and out of the memory as required. During execution, the memory of the process is swapped from the secondary to main memory during the startup of the job or process. The need to prioritize these processes is high because execution of these processes utilizes large amounts of resources. In order to free the memory, small processes are therefore loaded and executed faster to free up the memory for other functions. With more space being freed up in the memory, more process can be loaded, thus reducing the context switching time which consumes enormous amount of process resources. Demand paging also faces some extra latency when individual programs access the memory for the first time, thus the need to prioritize these processes according to some factors such as size, necessity, and memory and resource consumption.
Work Cited
Krzyzanowski, Paul. "Operating Systems: Memory Management". cs.rutgers.edu. N.p., 2012. Web. 23 June 2016.