[课业] 计算机概论 - 虚拟内存计算

楼主: editorer (Aeige)   2014-12-04 18:22:49
在计算机概论课本上看到的两题练习题,不过是英文的,所以我也用英文回答。
我对这些东西不是很了解,怕翻成中文以后会翻错,所以直接贴原文上来,保险一点。
题目(一):;A multiprogramming operating system uses paging.
The available memory is 60 MB divided into 15 frames, each of 4 MB.
Program A needs 13 MB. Program B needs 12 MB. Program C needs 27 MB.
Q1: How many frames are used by program A, B and C?
My answer -> Program A use 4 frames, program B use 3 frames,
and program C use 7 frames.
Q2: How many frames are unused?
My answer -> 15-(4+3+7) = 1. So 1 frame is unused.
Q3: What is the total memory wasted?
My answer -> 60 - (13+12+27) = 8. So 8 MB of memory is wasted.
Q4: What percentage of memory is wasted?
My answer -> 8/60 = 13.3% (approximately). So 13.3% of memory is wasted.
作者: claudia4096 (泠)   2014-12-05 11:10:00
故意不写答案吗? XDQ2, Q3 我不会把没用的那个 frame 当 waste, 因为它之后有需要还是可以被用。所以应该是4MB, 浪费率4/56Q5 我觉得题意不清,应该要看这OS 支不支援 thread和 multi-core其实整个题目二陷阱很多,处理 switching 的程式要不要占内存?当然要!那就不可能把100MB memory塞满你的程式。大学教科书这种要思辨的问题,还是去专版问吧
楼主: editorer (Aeige)   2014-12-05 17:27:00
好的,实在太感谢你了。

Links booklink

Contact Us: admin [ a t ] ucptt.com