A: Swaping in Paging(内存分配)

A: Swapping in Paging (memory allocation)

在操作系统课程中,我们的教授说

"when a page is no more necessary to be in the RAM it's taken in the swap-area of the memory. The Swap area is called like this for historical reasons, because it was used in a process called swapping, which involves the swap of a whole process. Indeed now we are taking in memory only one page, not an entire process."

这是正确的吗?我在网上找不到它!

是的,这是非常正确的,除了一(或两)件事:页面在需要更多 RAM 时被换出,而不是在页面不再需要时被换出。当不再需要时,释放页面。

关于"swap"这个词:确实是一个历史名称,但是说"swap"仍然是正确的,因为页面在[=21=之间交换了].

最后:整个进程 可以 驻留在 RAM 中,或者甚至只是其中的几页(或者根本 none!)。这取决于有多少 RAM 可用,以及操作系统如何分配可用内存。参见 linux swappiness 的例子:这是一个简单的控制,告诉内核它必须如何处理 RAM 和交换 space。