## Problem Set 4

Assigned: Feb. 24
Due: Mar. 3

### Problem 1

Suppose that there is 256M of RAM, and that the system uses variable length partitions for memory management. Suppose that jobs enter and terminate according to the following schedule:
```A of size 70M enters at time 0.
B of size 30M enters at time 10.
C of size 40M enters at time 20
A terminates at time 30.
D of size 20M enters at time 40.
E of size 100M enters at time 50.
C terminates at time 60.
F of size 30M enters at time 70.
E terminates at time 80.
G of size 20M enters at time 90.
H of size 80M enters at time 100.
H terminates at time 110.
```
Show how jobs are placed under each of the following memory allocation schemes: First-fit, best-fit, circular first-fit.

### Problem 2

In problem 1, suppose that the system is using first-fit and uses a free list to keep track of free memory. Show the state of the free list:
• Before and after F enters at time 70.
• Before and after H terminates at time 110.

### Problem 3

Suppose a paging system has a page size of 1 KByte. The current state of the page table PT is as follows:
```PT[0] = 4
PT[1] = -1
PT[2] = 0
PT[3] = 5
PT[4] = 2
...
```
The value -1 means that the page is not in memory.

For each of the following virtual addresses, state whether the corresponding page is in memory. If it is, then give the corresponding physical address: Virtual addresses 50, 1100, 2200, 3300, 4400. (Keep in mind that 1 KByte = 1024 bytes.)