3 ms·
> What would the cost be? All that would happen is that the free pages are marked as clean. That's a minor page fault. You get an OS-level exception, switch to
by scott_s 8y ago
> What would the cost be? All that would happen is that the free pages are marked as clean.
That's a minor page fault. You get an OS-level exception, switch to kernel mode, process the page fault by marking the page as loaded, then switching back to user mode. That is expensive if you do it a lot.
> but bound to be considerably cheaper than paging the page out and in again.
Yes, of course, a minor page fault is cheaper than a major page fault. But both are more expensive than no page fault, which is what happens if you just never free the page to the OS and there's plenty of available physical memory.