Memory is the focal piece of the considerable number of operations of a computer system. So in this section, we will learn out about the various kinds of memory management techniques and furthermore the advantages and disadvantages of various memory management techniques. Figure 1 represents to the absolute most pivotal memory management techniques:
Uni-programming memory management:
In uni-programming technique, the RAM is isolated into two categories where’s one category is for leaving the operating system and the other category is for the client process. Here the fence register is utilized which contains the last address of the parts of operating system. The operating system will contrast the client information addresses and the fence register and in the event that it is distinctive that implies the client isn’t entering the area of the operating system. The fence register is additionally called a limit register and is utilized to keep a client from entering the operating system region. Here the CPU use is poor and thus multiprogramming is utilized.
Also check: classification of embedded systems
Multi-programming memory management
In the multi-programming, the various clients can share the memory at the same time. By multiprogramming we mean there will be more than one procedure in the main memory and if the running procedure needs to hang tight for an occasion like input/output then as opposed to sitting on ideal conditions CPU will do a context switch and will pick another procedure.
Contiguous memory allocation
In the procedure of contiguous memory allocation, all the accessible memory space stays together in one spot. It implies openly accessible memory partitions are not dissipated to a whole extent over the entire memory space.
In the contiguous memory allocation, both operating system and the client must live in the primary memory. The primary memory is isolated into two segments where’s one segment is for the operations and other is for the client program.
In the contiguous memory allocation when any client procedure demands the memory a solitary segment of the contiguous memory block is given to that procedure as indicated by its need. We can accomplish the contiguous memory allocation by separating memory into the fixed-sized partition.
A solitary procedure is distributed in that fixed-sized single partition. Yet, this will build the level of multiprogramming that implies more than one procedure in the principle memory that limits the quantity of fixed partition done in memory. Internal fragmentation expands in light of the contiguous memory allocation.
Single Contiguous memory Allocation or fixed sized partition:
It is the most effortless memory management technique. In this strategy, a wide range of computer memory aside from a little part which is held for the working framework is accessible for one application. In other words it is also known as fixed sized partition of the system that separates memory into fixed-size segments (might possibly be of a similar size). In this whole partition is permitted to a procedure and if there is some wastage inside the segment is apportioned to a procedure and if there is some wastage inside the segment, at that point it is called an internal fragmentation.
For instance, the MS-DOS operating system designates memory along these lines. An embedded system likewise runs on a solitary application.
- Advantage: Management or accounting is simple.
- Disadvantage: Occurrence of Internal fragmentation.
Also check: Memory Fragmentation in Operating System
It is also called variable size segments/partitions. In which system isolates essential memory into different memory segments, which are generally adjacent classes of memory. Each segment stores all the data for a particular task/job. This technique comprises allocating a segment to occupation when it begins and unallocated when it closes. In the variable size partition, the memory is treated as one unit, and space allotted to a procedure is actually equivalent to require and the extra space can be reused once more.
- Advantage: This technique is free from internal fragmentation.
- Disadvantage: Management is troublesome as memory is getting absolutely divided after some time.
Non-contiguous memory allocation
In the allocation of non-contiguous memory, the accessible free memory space is dispersed to a great extent and all the free memory space isn’t in one spot. This technique is time-consuming. In the non-contiguous memory allocation, a procedure will procure the memory space however it isn’t at one spot it is at the various areas as indicated by the procedure prerequisite. This strategy of non-touching memory allocation reduces the wastage of memory which prompts internal and external fragmentation. This uses all the free memory space which is made by alternate processes.
Types of non-contiguous memory allocation
Paged Memory Management
This strategy category the computer’s primary memory into the fixed-size units that is known as page frames. This hardware memory management unit maps pages into frames that ought to be apportioned on a page premise.
- Advantages of paged memory management: It is free of external fragmentation.
- Disadvantages of paged memory management:
- It makes the interpretation extremely delayed as primary memory get to multiple times.
- A page table is a burden over the framework which consumes impressive space.
Segmented Memory Management
Management of Segmented memory is the only memory management technique that doesn’t provide the client’s program with a direct and adjoining address space.
Segments need equipment support as a segment table. It contains the physical address of the area in memory, size, and other information like access assurance bits and status.
Also check: Demand Paging in Operating System
Advantages of segmented memory management technique
- Allow the memory ability to be 1 MB despite the fact that the addresses related with the individual directions are 16 bits wide.
- Allow the utilization of independent memory regions for the program code and information and stack part of the program.
- It permits a program and additionally its information to be put into various areas of memory at whatever point the program is end.
- Multitasking turns out to be simple
Also check: segmentation in os
Disadvantages of segmented memory management technique:
- Availability of external fragmentation
- Algorithms of memory management are costly.
- Segmentation discovers free memory areas sufficiently large.
- Paging keeps rundown of free pages.
- Segments of inconsistent size not fit also for trading.