23,243 views
1 votes
1 votes
Segmentation may contain

a) Internal fragmentation

b) External fragmentation

c) Both

d) None

Also please explain the answer...

4 Answers

Best answer
6 votes
6 votes

Answer :B

Segmentation is similar to dynamic partitioning, only this time process can have several segments, while in dynamic partitioning a partition is accommodating the entire process.

A different memory management approach known as dynamic partitions (also called variable partition) which creates partitions dynamically to meet the requirements of each requesting process.

 

 DYNAMIC PARTITIONING

Each P is allocated exactly the required space (no internal fragmentation)                                                                         

Out-swapping P2 leaves a hole(External fragmentation) 


                                             

selected by
6 votes
6 votes
let a process A having code segment, data segment and many more segments for storage.. when it loaded into memory operating system allocate variable length segment to each i.e. data, code ..
scheme is variable length partition so no internal fragmentation.

 after some point of time der is a possibility that two segment of data (from two different process) may b free but  but individual size of these two data section is less than and combined size is greater than next segment which is waiting for memory..
so external fragmentation..
1 votes
1 votes

Answer is b)External fragmentation

Since segmentation follows  Variable Partition technique (Memory is divided into unequal size partitions)

let us say there are three processes which require 50KB,30KB,50KB

Initially there is 140KB memory is available with the OS now OS duty is to allocate the memory to processes

140KB

140 KB is divided into variable size partitions
 

70KB
30KB
40KB

since it is Variable partiotion technique OS uses BEST FIT algorithm to allocate the memories to  the processes 

P1 wants 50KB so best among all the partitions is 70 KB so p1 will be allocated to that slot now  P2 wants 30 KB as direct partition of 30KB is available P2 will be alloted there

now the diagram looks like this

P1(20KB left)
P2
40KB

Now one more request P3 with 50 KB came but we couldn't able to allocate  them even though we have  40+20=60KB free memory

this is external fragmentation.

If suppose we have partitions like

P2
P1(20KB)
40KB

OS can combine these free Blocks and it can make it as new partition of 60KB and it can allocate it .so occuring of External fragmentation depends on the patitions made by OS initially(if it makes 30KB,60KB,40KB respectively then we will not come across problem of External fragmentation for this problem) so Segmentation MAY suffer from External fragmentation

0 votes
0 votes
Option B

Internal fragmentation : the amount of memory wasted internal to any page alloted.

Suppose a process requires n frames and  little more space then n+1 frame has to be allocated .so almost a whole frame is wasted. This wastage is internal to the  frame of that process. Note it happens only when fixed size frames are allocated

Externalfragmentation  .the size of space requested < size of space available yet the request can't be granted because the spaces are scattered throughout the memory and not contiguous .it happens only when space is allocated variably.  

In segmentation variable size frames are allocated so segmentation suffers only from external fragmentation

Related questions

0 votes
0 votes
0 answers
4