In a
computer operating system that uses
paging for
virtual memory management,
page replacement algorithms decide which memory pages to page out (swap out, write to disk) when a page of memory needs to be allocated.
Paging happens when a
page fault occurs and a free page cannot be used to satisfy the allocation, either because there are none, or because the number of free pages is lower than some threshold.