在操作系统类(class)中,我们的教授说
"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”还是正确的,因为页面是从“swap area”交换到“swap area”。
最后:整个进程可以驻留在 RAM 中,或者甚至只是其中的几页(或者根本没有!)。这取决于有多少 RAM 可用,以及操作系统如何分配可用内存。例如,参见 linux swappiness
:这是一个简单的控件,告诉内核它必须如何处理 RAM 和交换空间。
关于linux - : Swapping in Paging (memory allocation),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41825795/