CS Electrical And Electronics
@cselectricalandelectronics
All PostsOperating SystemProgrammingWhat Is

What Is Memory Management In The Operating System, Techniques

Hello guys, welcome back to my blog. In this article, I will discuss what is memory management in the operating system, why memory management is required, different techniques used in memory management, what is swapping, what is memory allocation, what is paging, what is fragmentation, what is segmentation, what is dynamic loading, etc.

If you have any doubts related to electrical, electronics, and computer science, then ask questions. You can also catch me on Instagram – Chetan Shidling. 

Also, read:

What Is Memory Management

Memory management is regulating and coordinating computer memory by allocating parts of memory known as blocks to various operating applications to improve the system’s overall performance.

The management of primary memory is the most critical function of an operating system. It facilitates the movement of processes between the main memory and the execution disc. It assists the operating system in keeping track of all memory locations, whether they are allocated to a processor stay unallocated.

Why Memory Management Is Needed?

There are several reasons to use memory management:

  • It enables you to determine how much memory should be assigned to processes that determine which processors should receive memory at what moment.
  • Keeps track of when inventory is released or unallocated. It will, according to it, update the status.
  • It gives application routines the space they need.
  • It also ensures that these programs do not conflict with one another.
  • Assists in the protection of several processes from one another.
  • It loads the applications into memory to make the most of the available memory.

Memory Management Techniques

Here are a few of the most important memory management approaches:

01. Single Contiguous Allocation:

It is the simplest method of memory management. All types of computer memory are available for one program in this strategy, except for a limited fraction allocated for the operating system. This is how the MS-DOS operating system, for example, allocates memory. A single application also runs on an embedded system.

02. Partitioned Allocation:

It divides primary memory into several memory divisions, most of which are contiguous memory sections. Every division contains all of the data for a single task or job. This method involves allocating a partition to a job when it begins and unallocated it when it finishes.

03. Paged Memory Management:

This method divides the computer’s main memory into page frames, which are fixed-size units. This hardware memory management unit divides pages into frames and allocates memory on a page-by-page basis.

04. Segmented Memory Management:

The only memory management solution that does not provide a linear and contiguous address space to the user’s software is segmented memory. A segment table provides hardware support for segments. It holds the memory section’s physical address, size, and additional information such as access protection bits and status.

What is Swapping?

Swapping is a technique for temporarily moving a process from the main memory to the backing storage. It will be brought back into memory later for further execution.

The backing store is a hard disc or another secondary storage device that must be large enough to hold copies of all memory pictures for all users. It also has the ability to provide direct access to these memory images.

What is Memory allocation?

Memory allocation is the process of allocating memory or space to computer applications. Here, main memory is divided into two types of partitions:

  1. Low Memory – This sort of memory houses the operating system.
  2. High Memory- User processes are stored in a large amount of memory

Partition Allocation:

Memory is partitioned into several divisions or blocks. Each process is assigned based on the requirements. Internal fragmentation can be avoided by using partition allocation.

The various partition allocation schemes are listed below:

  • First Fit: This sort of fit allocates the partition, which is the first sufficient block from the main memory’s start.
  • Best Fit: It assigns the process to the partition with the least size among the available partitions.
  • Worst Fit: It assigns the process to the partition in the main memory that is the largest and most readily available.
  • Next Fit: It’s a lot like the first Fit, only this one looks for the first sufficient partition from the last allocation point.

What is Paging?

Paging is a storage mechanism that allows the operating system to fetch processes from secondary storage and store them as pages in the main memory. The primary memory is partitioned into little fixed-size pieces of physical memory called frames in the Paging method.

To get the most out of the main memory and avoid external fragmentation, the size of a frame should be the same as the size of a page. Paging is a logical approach for gaining faster access to data.

What is Fragmentation?

Processes are stored and withdrawn from memory, resulting in free memory space that is insufficient for other processes to occupy. Fragmentation occurs when processes cannot allocate memory blocks due to their small size, and memory blocks stay unused at all times. When free blocks are small in a dynamic memory allocation system, this type of problem occurs, and the system cannot fulfill any requests.

What is Segmentation?

The segmentation approach is very similar to paging. The sole distinction is that segments can be of any length, but pages in the paging approach are always of the same size.

The program’s main purpose, data structures, utility functions, and so on are all included in a program segment. For each process, the OS keeps a segment map table. A list of free memory blocks is also included, with their size, segment numbers, and memory addresses in the main memory or virtual memory.

What is Dynamic Loading?

A program’s dynamic loading routine isn’t loaded until the application invokes it. All routines should be stored in a relocatable load format on a disc. The main program will be executed after it has been loaded into memory. Dynamic loading also makes better use of memory space.

What is Dynamic Linking?

Linking is a mechanism for the operating system to collect and combine numerous code and data modules into a single executable file. The file can be loaded and executed from memory. System-level libraries can be linked into a program that combines them at load time. Libraries are connected at execution time in the dynamic linking method, allowing program code to be kept minimal.

As a result, memory management is one of the operating system’s most important roles. The operating system separates memory into primary and secondary memory and ensures that policies are in place to properly manage and control various memory types.

I hope this article ” What Is Memory Management ” may help you all a lot. Thank you for reading.

Also, read:

Share Now

Mayank Rochani

Content Writer