CSCI 331 Final Exam Short Answer Qs ACTUAL UPDATED QUESTIONS AND
CORRECT ANSWERS
The total number of holes and occupied blocks is 18 MB. Memory size is 18 MB. Hole size = block size = 1 KB. The 50% rule holds.
18 MB / 1 KB = 18,000 memory partitions
(a) Determine the total number of holes.
1/3 of the 18,000 memory partitions are holes:
18, = 6,000 holes
2/3 of the 18,000 memory partitions are holes: Memory size is 18 MB. Hole size = block size = 1 KB. The 50% rule holds.
18,000 * 2/3 = 12,000 occupied blocks
(b) Determine the total number of occupied blocks.
1/3 of the memory partitions are holes. If the total size of Memory size is 18 MB. Hole size = block size = 1 KB. The 50% rule holds.
all the partitions is 18 MB, then:
18 MB / 3 = 6 MB (or 6,000 KB) are occupied by holes (c) Determine the amount of space occupied by holes.
, There are 256 words per block or hole. Memory size is 256 MB. Hole size = block size = 1 KB. The 50% rule holds. Reading
The time required to move one block equals the number or writing one 32-bit word takes 10 ns.
of words per block multiplied by the time required to Assuming that all occupied blocks need to be moved, how long will it take to
move one word: compact the memory?
256 * 10 ns = 2560 ns = 2.56 microseconds
According to the 50% rule, if N blocks of memory may be
allocated to processes then 0.5N will likely end up as
fragmented memory space. We can assume that 1/3 of
the memory is fragmented and 2/3 is allocated. So, the
amount of memory to be compacted equals the amount
of memory allocated, which equals 256 MB * 0.66
Time required to compact all blocks
= number of blocks to be compacted * time required to
move one block
= (256 KB * 0.66) * (2.56 microseconds / KB)
= 432.5376 microseconds
If neither process calls f, then under static linking, 1 copy Define a measure of memory utilization as n * t where n is area (MB) and t is time
of f will be loaded into memory. The function f must be in (seconds). Processes p and q execute concurrently for m seconds. Halfway
memory regardless of whether it is actually called at through execution, both processes may call a shared function f. The size of each
runtime. process without f is k. The size of f is also k.
Determine the space-time requirement for both processes in each case:
Static linking and no sharing.
Only 1 copy of any shared function is necessary in Define a measure of memory utilization as n * t where n is area (MB) and t is time
memory. If both processes call f, then 1 copy of f will be (seconds). Processes p and q execute concurrently for m seconds. Halfway
loaded into memory. through execution, both processes may call a shared function f. The size of each
process without f is k. The size of f is also k.
Determine the space-time requirement for both processes in each case:
Static linking and sharing of f.
If neither process calls f, then under dynamic linking, 0 Define a measure of memory utilization as n * t where n is area (MB) and t is time
copies of f will be loaded into memory. A function f is (seconds). Processes p and q execute concurrently for m seconds. Halfway
loaded only when a process actually calls f. through execution, both processes may call a shared function f. The size of each
process without f is k. The size of f is also k.
Determine the space-time requirement for both processes in each case:
Dynamic linking and sharing when neither processes calls f.
If f is called by one process, the linker finds and loads f Define a measure of memory utilization as n * t where n is area (MB) and t is time
into memory. Only when a dynamically linked module is (seconds). Processes p and q execute concurrently for m seconds. Halfway
needed at runtime is the module linked and loaded into through execution, both processes may call a shared function f. The size of each
memory. If only 1 process calls f, it will not be necessary process without f is k. The size of f is also k.
to share the code for f with a second process.
Determine the space-time requirement for both processes in each case:
Dynamic linking and sharing when 1 process calls f.
CORRECT ANSWERS
The total number of holes and occupied blocks is 18 MB. Memory size is 18 MB. Hole size = block size = 1 KB. The 50% rule holds.
18 MB / 1 KB = 18,000 memory partitions
(a) Determine the total number of holes.
1/3 of the 18,000 memory partitions are holes:
18, = 6,000 holes
2/3 of the 18,000 memory partitions are holes: Memory size is 18 MB. Hole size = block size = 1 KB. The 50% rule holds.
18,000 * 2/3 = 12,000 occupied blocks
(b) Determine the total number of occupied blocks.
1/3 of the memory partitions are holes. If the total size of Memory size is 18 MB. Hole size = block size = 1 KB. The 50% rule holds.
all the partitions is 18 MB, then:
18 MB / 3 = 6 MB (or 6,000 KB) are occupied by holes (c) Determine the amount of space occupied by holes.
, There are 256 words per block or hole. Memory size is 256 MB. Hole size = block size = 1 KB. The 50% rule holds. Reading
The time required to move one block equals the number or writing one 32-bit word takes 10 ns.
of words per block multiplied by the time required to Assuming that all occupied blocks need to be moved, how long will it take to
move one word: compact the memory?
256 * 10 ns = 2560 ns = 2.56 microseconds
According to the 50% rule, if N blocks of memory may be
allocated to processes then 0.5N will likely end up as
fragmented memory space. We can assume that 1/3 of
the memory is fragmented and 2/3 is allocated. So, the
amount of memory to be compacted equals the amount
of memory allocated, which equals 256 MB * 0.66
Time required to compact all blocks
= number of blocks to be compacted * time required to
move one block
= (256 KB * 0.66) * (2.56 microseconds / KB)
= 432.5376 microseconds
If neither process calls f, then under static linking, 1 copy Define a measure of memory utilization as n * t where n is area (MB) and t is time
of f will be loaded into memory. The function f must be in (seconds). Processes p and q execute concurrently for m seconds. Halfway
memory regardless of whether it is actually called at through execution, both processes may call a shared function f. The size of each
runtime. process without f is k. The size of f is also k.
Determine the space-time requirement for both processes in each case:
Static linking and no sharing.
Only 1 copy of any shared function is necessary in Define a measure of memory utilization as n * t where n is area (MB) and t is time
memory. If both processes call f, then 1 copy of f will be (seconds). Processes p and q execute concurrently for m seconds. Halfway
loaded into memory. through execution, both processes may call a shared function f. The size of each
process without f is k. The size of f is also k.
Determine the space-time requirement for both processes in each case:
Static linking and sharing of f.
If neither process calls f, then under dynamic linking, 0 Define a measure of memory utilization as n * t where n is area (MB) and t is time
copies of f will be loaded into memory. A function f is (seconds). Processes p and q execute concurrently for m seconds. Halfway
loaded only when a process actually calls f. through execution, both processes may call a shared function f. The size of each
process without f is k. The size of f is also k.
Determine the space-time requirement for both processes in each case:
Dynamic linking and sharing when neither processes calls f.
If f is called by one process, the linker finds and loads f Define a measure of memory utilization as n * t where n is area (MB) and t is time
into memory. Only when a dynamically linked module is (seconds). Processes p and q execute concurrently for m seconds. Halfway
needed at runtime is the module linked and loaded into through execution, both processes may call a shared function f. The size of each
memory. If only 1 process calls f, it will not be necessary process without f is k. The size of f is also k.
to share the code for f with a second process.
Determine the space-time requirement for both processes in each case:
Dynamic linking and sharing when 1 process calls f.