Introduction To Memory Management

Memory management is the functionality of an operating system which handles or manages primary memory and moves processes back and forth between main memory and disk during execution. Memory management keeps track of each and every memory location, regardless of either it is allocated to some process or it is free. It checks how much memory is to be allocated to processes. It decides which process will get memory at what time. It tracks whenever some memory gets freed or unallocated and correspondingly it updates the status. 

Main Memory point out to a physical memory that is the internal memory of the computer. The word main is used to acclaim it from external mass storage devices such as disk drives. Main memory is also known as RAM. The OS is able to change only data that is in main memory. Coming as a result, every program we run and every file we access must be attended from a storage device into main memory.

All the programs are loaded in the main memory for implementation. Sometimes complete program is loaded into the memory, but sometimes a definite part or routine of the program is stuffed into the main memory only when it is tagged by the program, this mechanism is called Dynamic Loading, this rise the performance.

Also, at times one program is related or linked to some other program. In such a case, instead of loading all the dependent programs, CPU links the dependent programs to the main executing program when its required. This mechanism is known as Dynamic Linking.

 

Swapping

A action needs to be in memory for execution. But sometimes there is not adequate main memory to hold all the currently active processes in a timesharing system. So, surplus process are kept on disk and conduct in to run dynamically. Swapping is the process of lead in each process in main memory, running it for a while and then placing it back to the disk.

 


Contiguous Memory Allocation

In contiguous memory allocation each process is accommodated in a single contiguous block of memory. Memory is divided into several fixed size partitions. Each partition contains exactly one process. When a partition is free, a process is sort out from the input queue and loaded into it. The free structure of memory are known as holes. The set of holes is explore to regulate which hole is best to allocate

 

Memory Protection

Memory protection is a event by which we control memory access rights on a computer. The aim of it is to prevent a process from accessing memory that has not been allocated to it. Consequently put a stop to a bug within a process from affecting other processes, or the operating system itself, and rather results in a segmentation liability or storage breach irregularity being sent to the disturbing process, generally killing of process.


Memory Allocation

Memory allocation is a process by which computer programs allocate memory or space. It is of three types:

1.         First Fit:

The needed amount of memory is allocated in first block located in the heap that is big enough.

2.         Best Fit:

The entire heap is explored and the needed amount of memory is allocated in the block where there is the least amount of memory left over.

3.         Worst Fit:

This allocates a process to partition which is largest sufficient among the freely available partitions available in the main memory.

 

Fragmentation

Fragmentation occurs in a dynamic memory allocation system when most of the on the loose blocks are too small to assure any request. It is generally designated as inability to use the available memory.

In such circumstances processes are filled and detached from the memory. As a result of this, free holes exists to assure a request but is non contiguous i.e. the memory is break into large number of small holes. This situation is known as External Fragmentation.

Also, at times the physical memory is fragmented into fixed size blocks and memory is assigned in unit of block sizes. The memory assigned to a space may be a bit larger than the seek out memory. The contrast between allocated and required memory is known as Internal fragmentation i.e. the memory that is central to a partition but is of no use.

 


Paging

A solution to breakdown problem is Paging. Paging is a memory management process that permits the physical address range of a action to be non-contagious. At this moment physical memory is divided into blocks of equal size called Pages. The pages belonging to a certain procedure are loaded into available memory frames.

 


 Page Table

A Page Table is the data formation utilized by a virtual memory system in a computer operating system to store the mapping between virtual address and physical addresses.

Virtual address is also well known as Logical address and is generated by the CPU. While Physical address is the address that actually manage on memory.

 

Segmentation

Segmentation is another memory management plan that hold up the user-view of memory. Segmentation permits breaking of the essential address space of a single action into segments that may be set in non-contiguous areas of physical memory.

 

Segmentation with Paging

The both paging and segmentation have their advantages and disadvantages, it is better to merge these two schemes to boost on each. The merge scheme is known as 'Page the Elements'. All segments in this scheme is split into pages and all segments are maintained in a page table. So the logical address is split into following 3 parts:

           Segment numbers(S)

           Page number (P)

           The displacement or offset number (D)

Comments

Popular posts from this blog

Virtualization

Research Paper Writing