DeNasti
DeNasti

Reputation: 97

A: Swapping in Paging (memory allocation)

During a course of Operative System, our professor said

"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."

Is this correct? i can't find it anywhere online!

Upvotes: 0

Views: 436

Answers (1)

Yes, it is quite correct, apart one (or two) things: a page gets swapped out when there is need for more RAM, not when the page is no more needed. When is no more needed, a page is freed.

About the "swap" term: it is true that it is a historical name, but nevertheless it is still correct to say "swap", because pages are swapped from and to the "swap area".

Finally: a whole process can reside in RAM, or even just a few pages of it (or none at all!). It depends on how much RAM is free, and how the operating system allocates the available memory. See for example the linux swappiness: it's a simple control to tell the kernel how it must treat RAM and swap space.

Upvotes: 2

Related Questions