0% found this document useful (0 votes)
21 views4 pages

Os12 Memory Management Part 2 85

Hdhsgege hdhdhdhdh hdhshshe sjjajjahdhhe shhdhehhe sjjsjejje adhikansh shahnshah jsjrjrjr sjjsj

Uploaded by

SANDEEP Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Os12 Memory Management Part 2 85

Hdhsgege hdhdhdhdh hdhshshe sjjajjahdhhe shhdhehhe sjjsjejje adhikansh shahnshah jsjrjrjr sjjsj

Uploaded by

SANDEEP Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

www.gradeup.

co

1
www.gradeup.co

Content :-
1. Multiprogramming with variable partition
2. Paging
3. Segmentation

Multiprogramming with Variable Partition


Static partitioned of memory is generally suitable for static environment where, the workload
is predicable and its characteristic are known . Static partitioning is at disadvantage , in a
environment with varying and generally unpredictable memory requirements of programs,
prior to their submission.
Most of the disadvantage of static partitioning are directly attributed to its inflexibilty and
inability to adapt to changing system needs. One of its primary problem is internal
fragmentation of memory.
To remove such problems attributed to static partitioning of memory, dynamic (variable)
partitioning is used in which partitions are defined dynamically rather than static.
In dynamic partitioning, the partitions used are of variable length and number. When a
process is brought into the memory , it is allocated exactly to that amount of memory that it
needs, not more than that it requires. External fragmentation, referring to the fact that the
memory that is external to all partitions becomes increasingly fragmented.

One technique for overcoming external fragmentation is compaction, which means to move
the processes in the memory in such a way that the scattered pieces of unused memory
(holes) can be placed together, so that any other process demanding contiguous memory for
it can be use.

Depending upon the situation either of the following three algorithms are used for
selection of a free area of memory to create partition:-
a. First fit and its variant, next fit
b. Best fit
c. Worst fit

a. In first fit , we allocate the first hole that is big enough. Searching can be started either at
the beginning of the set of holes(first fit) or where the previous first fit search ended (Next
fit). We stop searching as we obtain a free hole that is large enough to accommodate the
coming process.
b. In best fit, we allocate the smallest hole that is large enough. Searching of entire list is
done unless it is sorted by size.This strategy produces least size of unused memory
space(fragments).
c. In worst case , we allocate the largest hole. Again we search the entire list, unless it is
sorted by size. This strategy procures largest size of unused memory space.

Note: - first fit and Best fit is better that worst fit in terms of deceasing both time and
storage utilization . Neither first fit nor best fit can be said better in terms of storage utilization
as they again results to external fragmentation. One of the solution is compaction but it is
time consuming approach another possible solution is to permit the logical address space of
a process to be non-contiguous. Thus allowing a process to be allocated in physical memory
.

2
www.gradeup.co

Paging :- Paging is a memory management schemes that removes the requirement of


contiguous allocation of physical memory. Physical address space of a process to be non-
contiguous is permitted by this scheme
The physical memory is conceptually divided into a number of fixed-size blocks called frames,
and the logical address space (virtual address space) is also splited into fixed size blocks
called pages.
In paging system , address translation is performed with the help of a mapping table called
page-map table (PMT). PMT is constructed at process loading time in order to establish the
correspondence between the virtual and physical address . In PMT, there is one entry for each
page of a process indexed with the page number. The value of each entry is the number or
frames (Composed of high order, page level bits) in the physical memory when the
corresponding page is placed.

Where ‘P’ is the index number in the page table and ‘d’ is the offset value(displacement)

Note:- If the page size is not the power of 2 then separation of ‘p’ and ‘d’ is not possible.

Segmentation :- It is another technique for non-contiguous storage allocation. The


difference between segmentation and paging is , as pages are physical in nature and hence
are of fixed size , whereas segments are logical divisions of a program and hence are variable
size. In segmentation, logical address space is divided into different segments. The general
division can be : main program , set of subroutine , procedures , functions and a set of data
structure (stack, array etc). Each segment has a name and length which is loaded into the
physical memory as it is . For simplicity, the segments are referred by segment number rather
than segment name .
Thus , a logical address consists of two tuples :
<segment_name , offset>

Segmentation with paging (Combined Approach):


Both approaches paging and segmentation have their respective advantages and
disadvantages and none is superior to other over all characteristics. Some computer systems
combine the two approaches to avail the advantages of both approaches in a single system.
This approach facilitates to use the segmentation from the user’s point of view also to divided
each segment into pages of fixed size for allocation purposes. In this way , the combined
system retains not only the advantages of segmentation but also the problems of complex
segment placement and management of secondary memory eliminated by using paging.

3
www.gradeup.co

You might also like