Memory Management And Contiguous, Non-contiguous memory allocation

The operating system will decide which process on secondary memory will get which area in main memory
This is also an important concept in operating system
There is two important memory allocation policy

  1.           Contiguous memory allocation
  2.       Non-contiguous memory allocation

Contiguous memory allocation:
When we take a complete process from secondary memory to main memory all together then is called contiguous memory allocation

Non-contiguous memory allocation:
When we take a process from secondary memory we brake it into pieces then we take it to main memory then it can arrange in different areas in main memory

In starting means in 1980s 1990s we have contiguous memory allocation so slowly we understand it faces a number of problems especially external fragmentation so we move to non-contiguous memory allocation policy so there is no need to store process in secondary memory to main memory all together. Our process divide into pieces that separately allocate into main memory that is paging
As we Know In Contiguous memory allocation memory allocated in sequence:
For Example: -
 We take an array because array is simple example of memory allocation
When you declare an array in memory it sequentially arrange in memory











Contiguous memory allocation advantages
As array arranged in contiguous (sequential) manner it
ð  Address translation will be easy
ð  Access time will be
Less because all elements in the sequence we just need to remember the base element
 But the problem is that Contiguous allocation always suffer from external fragmentation,
 For example, we have an array of 10 kb within center 2kb in occupied
                           ÃŸ-----------------------------------------10kb---------------------------------------à




Full
Full





                                                                4kb                                                                                         4kb

And we have a process of 5kb to allocate in main memory from secondary memory
The process need memory allocation in a contiguous manner (sequential manner) we have space but not in a contiguous manner this problem in non as external fragmentation
In Non Contiguous memory Allocation memory can be store any ware in memory:
For example:-
Linked list which cannot allocate in sequence
The linked list works as there are pointers which give the address of next node












We just have now pointer value through which we can access each node in a lenient fashion
Question: - Can we access directly n node directly or any node in the linked list directly
Answer: - “NO”
External fragmentation can also not arise because there is no sequence allocation we take the same example
         ÃŸ-----------------------------------------10kb---------------------------------------à




Full
Full





                                                                4kb                                                                                         4kb
We have a process of 5kb to allocate in main memory from secondary memory
ß-----------------------------------------10kb---------------------------------------à
------
------
-------
------
Full
Full



------

                                                                4kb                                                                                         4kb
The process does not need memory allocation in a contiguous manner we have space firstly we allocate free memory when allocated memory comes pointer to point to other empty space in whole memory and linked it by    remembering the address but not in a contiguous manner so the problem of external fragmentation also remove
We have studied

  • Memory Management and their important criteria’s.
  • Memory Management and Contiguous & non-contiguous memory allocation.
Next, we will study

  • Memory Management and Levels of Cashe
  • Memory Management and cache mapping

Comments