Storage management plays an important part in operating system. It deals with the storage procedures in the computer system using an operating system. Details about this is as follows −
Memory management plays an important part in operating system. It deals with memory and the moving of processes from disk to primary memory for execution and back again.
The most important concepts in memory management are paging and segmentation. Details about these topics are given below −
In a computer system, virtual memory can be created that is more than the actual memory available i.e. physical memory. To implement this, the concept of paging is used.
In paging, the logical address space is divided into pages and the physical address space is divided into frames. The size of both the pages and frames is the same. The process is measured by the number of pages.
Now, these pages are brought from the logical address space to the physical address space by storing the pages into the frames. A page table is created to find out which page is stored in what frame.
This concept is explained more clearly using the following example −
The explanation of the above example is as follows −
This is a memory management technique that supports the user view of memory. The logical address space is divided into a group of segments. These segments have a name and memory length. So, the segment address is specifies using its name, base address and length.
The segments in logical address space appear as follows −
The most important concepts in virtual memory are demand paging and thrashing. Details about these topics are given below −
A demand paging basically contains paging with swapping. A page of the process is only brought into the main memory if it is required.
The steps required for demand paging are −
A diagram to illustrate demand paging is −
Thrashing occurs when there are not enough frames for a process process. Suppose all the pages of a process in main memory are in active use. If it requires another page from secondary memory, then it needs to replace a page. However the replaces page was also active and it is brought back into the memory by replacing yet another page. So if there is more paging than processing going on in the system, then thrashing has occurred.
Thrashing results in many performance issues for the system. One way to remove thrashing is to reduce the degree of multiprogramming for the system. Another is to use the Working Set Model.