0% found this document useful (2 votes)
266 views4 pages

Tutorial - 3

This document discusses memory management techniques including: - The differences between page and segment memory allocation schemes - Memory allocation schemes that require the entire job to be stored in memory - Calculating the address of an instruction using page tables - How page tables differ between paging and segmentation - How demand paging allows jobs to run with less memory than their size

Uploaded by

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

Tutorial - 3

This document discusses memory management techniques including: - The differences between page and segment memory allocation schemes - Memory allocation schemes that require the entire job to be stored in memory - Calculating the address of an instruction using page tables - How page tables differ between paging and segmentation - How demand paging allows jobs to run with less memory than their size

Uploaded by

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

TMC1234 Operating System

Semester 2 2014/2015
Tutorial 3: Memory Management (Part 2)

1. Explain the differences between a page memory allocation scheme and a


segment memory allocation scheme.

2. List the memory allocation scheme that required the entire job to be stored in
main memory.

3. List down the step on how to calculate the exact address of the instruction of
byte 214 in main memory when using paged memory allocation. Assume that
each page size is 100 and use the below Page Map Table (PMT) for Job 1.
Page Map table for Job 1
Job Page No
0
1
2
3

Page Frame No
8
10
5
11

4. Describe how the function of the Page Map Table (PMT) differs in paged vs.
segmented/demand paging memory allocation.

5. Demand paging allows the user to run jobs with less memory than the size of the
job. How is this possible?
6. What is the cause of thrashing?
7. What is the working set?

8. Given that main memory is composed of three page frames for public use and
that a seven-page program (with pages a, b, c, d, e, f, g) requests pages in the
following order:
a, b, a, c, d, a, e, f, g, c, b, g
a. Using the FIFO page removal algorithm, do a page trace analysis indicating
page faults with asterisks (*). Then compute the failure and success ratios.
b. Increase the size of memory so it contains four page frames for public use.
Using the same page requests as above and FIFO, do another page trace
analysis and compute the failure and success ratios.
c. Did the result correspond with your intuition? Explain.

9. Given that main memory is composed of three page frames for public use and
that a program requests pages in the following order:
a, d, b, a, f, b, e, c, g, f, b, g
a. Using the FIFO page removal algorithm, perform a page trace analysis
indicating page faults with asterisks (*). Then compute the failure and success
ratios.
b. Using the LRU page removal algorithm, perform a page trace analysis and
compute the failure and success ratios.
c. Which is better? Why do you think it is better? Can you make general
statements from this example? Why or why not?

10.Given that main memory is composed of four page frames for public use, use the
following table to answer all parts of this problem:
Page
Frame

Time When
Loaded

0
1
2
3

126
230
120
160

Time When
Last
Referenced
279
280
282
290

Referenced
bit

Modified Bit

0
1
1
1

0
0
1
1

a. The contents of which page frame would be swapped out by FIFO?


b. The contents of which page frame would be swapped out by LRU?

11. Given three subroutines of 700, 200, and 500 words each, if segmentation is
used then the total memory needed is the sum of the three sizes (if all three
routines are loaded). However, if paging is used then some storage space is lost
because subroutines rarely fill the last page completely, and that results in
internal fragmentation. Determine the total amount of wasted memory due to
internal fragmentation when the three subroutines are loaded into memory using
each of the following page sizes:
a. 100 words
b. 600 words
c. 700 words
d. 900 words

12.

Given the following Segment Map Tables for two jobs:


SMT for Job 1
Segme
nt
Numb
er

Memory
Location

4096

6144

9216

2048

7168

SMT for Job 2


Segme
nt
Numb
er

Memory
Location

2048

6144

9216

a. Which segments, if any, are shared between the two jobs?


b. If the segment now located at 7168 is swapped out and later reloaded at 8192,
and the segment now at 2048 is swapped out and reloaded at 1024, what would
the new segment tables look like?

You might also like