Memory management: An integral part of the Operating System

memory-management

Memory management implies the functionality of an OS which tries to manage and handle primary memory. During the time of execution, memory unit processes back and forth between all main memories. Memory management keeps in check each memory location even if it is allocated to one process or it’s free. Memory processing unit evaluates the amount of memory allocated to various processes. It has the authority to decide which process will get how much amount of memory at a certain time. It synchronizes with the free or unallocated memory and updates the status in real time.

In system hardware, memory management includes components which physically stores the data, such as chips, RAM, flash-based SSDs and memory caches. In the operating system, memory management includes the constant reallocation of certain memory blocks to a particular program as the system user deems changes. This blog intends to provide you with all the information based on memory processing in the CPU. Meanwhile, students can look for Assignment help Uk portal which assists CS aspirants who are working on an algorithm project and data structure.

Introduction to memory management

Main memory implies a physical memory that has its internal memory in the system. The word primary is used to distinguish it from disk drives and other external mass storage devices such as pen drive. Main memory is also referred to as RAM ( random access memory). The system is able to alter the data which is the main memory, so every program or task which we execute or any file which we try to access gets copied from external storage device to main memory.

All the programs get loaded in the main memory for the process of execution. Sometimes a whole program gets loaded in the main memory or some subprocess gets loaded into the main memory but only when the program requires it. The Mechanism is known as Dynamic Loading which enhances the efficiency of the system.

Also, some of the times a program is co-dependent on various other programs. In those cases, rather than initiating the all the linked programs, CPU links the dependent memory of those programs in main memory allocation. The mechanism is also famous as Dynamic Linking.

Our assignment expert is more than proficient in writing projects for students who are pursuing a major in Computer Science.

Swapping

A process is required to have some memory allocation for the process of execution. But there is not enough amount of the main memory to hold all the ongoing active processes in real time situation. So, the excess process is kept on hold and brought on to run dynamically. Swapping the program is the process of bringing the various process in every memory, executing it for a while and shifting it back to the secondary memory.

Memory Allocation (Contiguous)

In contiguous memory allocation, every process is included in a single and contiguous block of data. Memory gets divided into many fixed file size partitions. When a fixed partition gets free, a process is selected from the hold off queue or input queue and gets loaded into it. The free partition of memory is also known as holes. The series of holes is searched to make sure which hole is best for the file allocation.

Protection of memory

Protection of memory is a technique by which a user can control memory access on a system. The main objective is the prevention of a process accessing the whole system memory that has not been allocated to it. Therefore it prevents a bug within a process from altering other processes, or for OS itself. It instead results in storage violation exception or segmentation fault being sent to the disturbing process, normally killing the process.

Types of memory allocation

Allocating the memory is defined using a process by which all computer tasks are assigned space or memory. Memory allocation is of three types which are:

Best Fit

The smallest hole in the memory unit which is large enough to allocate a program.

Worst Fit

The largest type of hole in the memory unit that is big enough to allocate a program.

First Fit

The first hole that comes fastest while allocating and which is big enough to store a program.

Fragmentation

Fragmentation is a phenomenon that occurs in a dynamic process of memory allocation system when most of the free memory blocks are small to provide the space for the program. It is often known as the inability to use free memory.

In such cases processes gets loaded and removed from the main memory. Which leads to free holes that get free to satisfy any request but also the free memory is non-contagious. It implies that memory is fragmented or ceased into a large number of small holes, often labelled as External Fragmentation.

Also in some cases, the physical memory is broken into many fixed size blocks and memory is allocated in many units of block sizes. If the memory allocated to a file location is slightly minimal than the process requested memory. The difference between required and allocated memory is labelled as Internal Fragmentation the type of memory which is available to the partition but have no use.

Paging

A viable solution to the above issue of fragmentation is Paging. Paging refers to a memory managing technique which enables the physical address space as a process to be non-contagious. In this case, the physical memory gets divided into various blocks of the same size known as Pages. The pages which belong to a particular process gets loaded into free memory frames.

Page Table

A page table is a type of data structure which is enabled by a virtual memory system in computer OS to store all the mapping between physical addresses and virtual address.

The virtual address is also labelled as logical address and is produced by the central processing unit. While the physical address is the actual location of the data which actually exist on the memory.

Segmentation

The process of Segmentation is another type of memory management mechanism that allows the user to view the partition of memory. Segmentation also enables breaking the series of virtual address space going through a single process into various segments that are placed in all types of non-contagious fields of Physical Space.

Segmentation with Paging

Both segmentation and paging have their share of advantages and disadvantages. It is better to add up both schemes to enhance their performance on each other. The combined scheme is referred to as “page with elements”. There are several pages in each segment of the scheme and each segment is maintained as page tables. There are three parts of logical addresses.

  • Page Number (P)
  • Segment Numbers (s)
  • Alteration of offset number (D)

Conclusion

In any programming system, apt main memory management is as essential as fuel to produce energy. The part of the OS is also known as a memory processing unit and the various mechanism of memory management such as swapping, fragmentation and protection is also important for any algorithm. Students can access more pieces of information related to memory management using our online assignment help portal.

.