Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space

Apparently, the virtual memory should hold all the pages of his processes.

My question is whether on running a process, all the pages of a process are loaded in the swap space from their original location in hard disk.

What are the factors that determine when a page will be loaded in the swap space?


1 Answer 1


If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. That is largely the answer, but how its decided that a page is inactive and should be moved to swap? It depends on the page replacement algorithms being used.

Mostly demand paging is used.

Nothing gets loaded to swap directly from the hard disk. On the hard disk pages do not exist; pages exist only when a program is loaded in memory, and it's from there they get transferred (swapped) to swap space and that's done according to paging algorithms.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .