Storage Management


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

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 −

Paging

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 −

Paging

The explanation of the above example is as follows −

  • The logical address is 13 bits. In this first 3 bits represent the page number and the rest of the bits are page offset.The physical address is 12 bits. In this first 2 bits represent the frame number and the rest of the bits are page offset.
  • The size of the page and frame is 1 KW. There are 8 pages in the logical address space and 4 frames in the physical address space.
  • The page table specifies the location of pages in frames. It contains 8 rows, one for each page and the contents of these rows are the frame in which that particular page is stored. This is known as the page table entry.
  • For example, in the page table row 7 contains value 00. That means page 7 is stored in frame 0 in the physical address space.

Segmentation

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 −

Segmentation

Virtual Memory

The most important concepts in virtual memory are demand paging and thrashing. Details about these topics are given below −

Demand Paging

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 −

  • Check if the page demand was for a valid memory access or not.
  • If the reference was invalid, the process is terminated. However, if the reference was valid and the page is not available in main memory, then it is brought in.
  • First a free frame is found and then the required page is read into the frame.
  • Then the internal page table is modified to direct that the required page is now available in main memory.
  • After all this, the process can access the page as if it was always available in the memory.

A diagram to illustrate demand paging is −

Demand Paging

Thrashing

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.

Updated on: 22-Jun-2020

7K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements