This problem explores the differences in memory utilization between paging and s
ID: 3830303 • Letter: T
Question
This problem explores the differences in memory utilization between paging and segmentation. The numbers and addresses are in decimal. Consider a system that has 512Kbytes of RAM dedicated to the storage of user programs during their execution. The following three programs are being run concurrently on the system. Program A: 67Kbytes; Program B: 256Kbytes; Program C: 161Kbytes.
Scenario 1: The system implements virtual memory using paging. The page size is 64Kbytes. At a particular moment, the page tables of the 3 programs look like this:
Program A
Program B
Program C
Page
Frame
Page
Frame
Page
Frame
A0
5
B0
2
C0
7
A1
0
B1
1
C1
3
B2
-
C2
-
B3
4
Show the RAM usage in the table below. Compute the unused RAM that is wasted to internal fragmentation.
Page in use in RAM (such as A0, A1 etc)
Usage
Wastage
Total wastage of memory due to internal fragmentation =
Program A
Program B
Program C
Page
Frame
Page
Frame
Page
Frame
A0
5
B0
2
C0
7
A1
0
B1
1
C1
3
B2
-
C2
-
B3
4
Explanation / Answer
Page size = 64 KB
Program A size = 67 KB
So, No of pages in Program A = ceil(67 KB/ 64 KB) =2
Program B size =256 KB
So, No of pages = ceil (256 KB/64 KB)=4
Program C size =161 KB
So, No of pages =ceil (161 KB/64 KB) = 3
Program has 2 pages A0 and A1. A0 has size 64 KB which is full and A1 size is also 64 KB out of which only 3 KB is full , rest of 61 KB is empty. The wasted space left in the last page is called as internal fragmentation.
Similarly , wastage for rest of the pages is calculated.
RAM size is 512 KB. So, (512KB/64KB)=8 pages can be allocated in RAM. The place where pages are stored is in RAM is called as Frame Number.
Page in use in RAM (such as A0, A1 etc)Usage Wastage A0 64 KB 0 KB A1 3 KB 61 KB B0 64 KB 0 KB B1 64 KB 0 KB B3 64 KB 0 KB C0 64 KB 0 KB C1 64 KB 0 KB C2 33 KB 31 KB Total wastage of memory due to internal fragmentation = 92 KB
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.