The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
79 views
I have read that paging does not suffer from external fragmentation as the frames and the pages are all of the equal sizes, but when we store a last level page table in a frame at that time it may not fully occupy the frame. Similarly, if n such page tables are stored, that does not occupy the frames entirely, then there can be a case where all the gaps exceed a page size. Then there should be external fragmentation, right? So why is it said that paging does not have external fragmentation?
asked in Operating System by Active (3.3k points) | 79 views
0
When page table is not fit into the one frame then we apply paging on the page table. After applying paging  there in no external fragmentation.
0
U are not getting my point. I am talking about the multilevel page table itself, in the multilevel page table, the last page table is lesser than the total frame size in most of the cases, which results in internal fragmentation. If many such cases happen, then will there not be a chance of external fragmentation?
0
No it is still internal fragmentation. external fragmentation happens when space is available but we can't allot it to a process.
0

I am presenting that case only, see the case below

 Here frames are of 4KB, now say a page of size 4KB comes... will it not suffer from external fragmentation fragmentation?

0
So you are trying to say that if there are many internal fragmentation in a system then it creates external fragmentation ?
0
is it not?
0

Internal Fragmentation occurs when a fixed size memory allocation technique is used. External fragmentation occurs when a dynamic memory allocation technique is used.

https://www.differencebetween.com/difference-between-internal-and-vs-external-fragmentation/

0

I will like to deny..

https://www.geeksforgeeks.org/fixed-or-static-partitioning-in-operating-system/

Moreover, just look at your own definition of external fragmentation-->

external fragmentation happens when space is available but we can't allot it to a process.

Haven't I presented the same case above?

0
yes you are correct.

But external fragmentation also depends on size of process.

external fragmentation happens when we can't allocate a new process some space but the space is still available.

In the case which you are telling  we will have external fragmentation if  you fill the whole space provided to store the page tables and then a new page table comes. Then we will no frame left to allocate it. But that case is rare.
0

In the case which you are telling  we will have external fragmentation if  you fill the whole space provided to store the page tables and then a new page table comes. Then we will no frame left to allocate it.

meaning??

0
2kb and 2kb space allocated a 4kb process in non contiguous manner

So there is no external fragementation because all space utilized properly

We had 4kb space and process size also 4kb

1 Answer

+1 vote

We do paging because we want a process to be stored in non contiguous manner in the main memory.

So we divide main memory in equal size partition called frames and secondary memory space also in equal size partition where each partition is called page such that

Size of page = size of frame.

here size of each frame is fixed so we have fixed size partitioning scheme thus leading to internal fragmentation in the main memory.

Since size of secondary memory > size of main memory(let)

so we will have more pages as compared to frames.

let there be 4 frames in main memory and 7 pages in secondary memory.

Suppose there is a process which occupies $3$ pages in secondary memory i.e. $P_1,P_2,P_3$ pages are occupied in secondary memory and the remaining pages are still free.

So we will now pick each of the page and find a frame for it to store it in main memory.

page frame allocated
1 2
2 1
3 4
4  
5  

Suppose the allocation goes like shown above.

now only frame 3 is empty.

Now we store the above table(page table) also in a frame and we only have frame 3 left to allocate it as all other frames are occupied.

SO NOW MAIN MEMORY IS FULL SINCE ALL THE FRAME OF MAIN MEMORY IS OCCUPIED.

now suppose a new process is created in Secondary memory and it occupies $P_4,P_5,P_6$ so now we want to execute it so we again need frames but frames are full.

So we will deallocate the frames and delete the page table to process 1 and give it to pages and page table of process 2 now process 2 will execute.

If process 2 would have been of size 6 pages then concept of virtual memory would have been used.

So NO EXTERNAL FRAGMENTATION

answered by Boss (16.1k points)

Related questions

0 votes
1 answer
2
0 votes
1 answer
4
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,814 questions
54,521 answers
188,389 comments
75,425 users