Memory Virtualization

Address Space:-

  The range of virtual addresses that the operating system assigns to a user or separately running program is called an address space. This is the area of contiguous virtual addresses available for executing instructions and storing data.

Address Translation:-

    When the system allocates a frame to any page, it translates this logical address into a physical address and creates an entry into the page table to be used throughout the execution of the program. When a process is to be executed, its corresponding pages are loaded into any available memory frames.


Segmentation:-

        Segmentation divides processes into smaller subparts known as modules. The divided segments need not be placed in contiguous memory. Since there is no contiguous memory allocation, internal fragmentation does not take place. The length of the segments of the program and memory is decided by the purpose of the segment in the user program.

We can say that logical address space or the main memory is a collection of segments.



Thrashing:- The effective access time will be the time needed by the CPU to read one word from the secondary memory if the number of page faults is equal to the number of referred pages or if the number of page faults is so high that the CPU is only reading pages from the secondary memory. This is known as Thrashing.

If the page fault rate is PF%, the time spent retrieving a page from secondary memory and resuming is S (service time), and the memory access time is “ma”, the effective access time may be calculated as follows:

                                        EAT = PF x S + (1 - PF) x (ma)   


Swapping:-  Swapping comprises either erasing all of the process's pages from memory or marking the pages so that we can remove them via the page replacement method.

When a process is suspended, it indicates it is unable to run. However, we can change the process for a while. The system can swap the process from secondary memory to primary memory over a period of time. Thrashing describes a condition in which a process is busy, and the pages are swapped in and out of it.


Free Space Management:- The operating system manages the free space in the hard disk. This is known as free space management in operating systems. The OS maintains a free space list to keep track of the free disk space. The free space list consists of all free disk blocks that are not allocated to any file or directory. For saving a file on the disk, the operating system searches the free space list for the required disk space and then allocates that space to the file. When a file is deleted, the space allocated to it is added to the free space list.

There are four methods of doing free space management in operating systems. These are as follows-

  • Bit Vector
  • Linked List
  • Grouping
  • Counting