Memory Management in Operating System

Share Now

Memory Management in Operating System explains types of memory management, partitioning methods, virtual memory concepts, and memory allocation strategies in operating systems.

Memory Management in Operating System

Memory Management

Memory management is one of the most important functions of an operating system (OS). It deals with allocation, deallocation, protection, organisation, and sharing of memory. The main functions performed by memory management are –

  • Memory Allocation: Giving space in memory to a program whenever required.
  • Memory Deallocation: Taking back the memory after the program finishes.
  • Memory Protection: Ensuring one program doesn’t disturb another program’s memory.
  • Memory Organisation: Keeping track of which part of memory is used and by which process.

A Types of Memory Management Systems

1. Contiguous Real Memory Management

Memory is given in one continuous block. There are three types of contiguous real memory management.

  • Single Contiguous System: Entire memory given to one process.
  • Fixed Partition System: Memory divided into fixed-size partitions.
  • Variable Partition System: Memory divided into variable-size partitions.
2. Non-Contiguous Real Memory Management

Memory is divided into separate sections; processes can occupy non-continuous blocks. There are three types of non-contiguous real memory management.

  • Paged Memory System: Memory divided into equal-sized pages; processes split into pages.
  • Segmented Memory System: Memory divided into segments based on logical divisions (code, data, stack).
  • Combined Memory System: Uses both paging and segmentation together.
3. Non-Contiguous Virtual Memory Management

Only part of the process is loaded into memory at a time. Allows execution of processes larger than physical memory. The types of non-contiguous virtual memory management are:

  • Virtual Memory System: Uses techniques like paging and swapping to extend memory beyond physical limits.

Partitioning in Memory Management

Partitioning means dividing the main memory into smaller parts, which is called partitions, so the multiple programs or processes can be loaded and executed at the same time. It helps memory efficiently and allow multiprogramming. There are three types of partitioning –

  • Single Contiguous System
  • Fixed Partition System
  • Variable Partition System

(i) Single Contiguous System

In a single contiguous system, the entire memory is used for one program only. OS occupies a small part, and the rest is given to a single user program. No multiprogramming possible. This method is used in previous computers.

(ii) Fixed Partition System

Memory is divided into fixed-size partitions at system startup. Each partition can hold one process at a time. Partition sizes cannot change while the system is running.

Advantages:

  • Simple and easy to implement.
  • Supports multiprogramming.

(iii) Variable Partition System

Memory is divided dynamically based on process size. Each process gets exactly the memory it needs. When a process finishes, its space can be reused.

Advantages:

  • Better memory utilisation (less internal waste).
  • The number of processes is flexible.

Terms Of Virtual Memory

  • Page Fault: Page faults happen when the process wants to access a page and that page is not found in RAM. In that condition the RAM fetches the file from the disc. For example, if a program wants to read the file but the page is stored only on the disc.
  • Working Set: When the page is available in the memory and it starts execution. For example, if the program is executing the loop.
  • Demand Paging: When the page is loaded into memory only when it is required, it helps to reduce RAM utilisation. For example, if a large document is open, then only the visible portion loads; the rest loads when it is scrolling.
  • Dirty Bit (Dirty Page): When the page is modified after being loaded from the disc and written back before replacement. For example, if a Word document is modified or edited, then its page becomes “dirty”.
  • Locality of Reference: When the program accesses the same memory location repeatedly for the same time. For example, if the same data and instruction are accessed again and again.
  • Page Replacement Policy: When the page to replace when the memory is full. For example, suppose there are 4 pages in the memory and a 5th page is needed; then one page is replaced based on the chosen policy.

Disclaimer: We have provide you with the accurate handout of “Memory Management in Operating System“. If you feel that there is any error or mistake, please contact me at anuraganand2017@gmail.com. The above study material present on our websites is for education purpose, not our copyrights.

Images and content shown above are the property of individual organisations and are used here for reference purposes only. To make it easy to understand, some of the content and images are generated by AI and cross-checked by the teachers.

cbseskilleducation.com

Leave a Comment