Jump to content

Talk:Demand paging

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Misleading "advantages"

[edit]

I'd like to contest the that the "Does not load the pages that are never accessed" claim is actually an advantage. You might say that about a theoretical model of demand paging, but in practical computing, the overhead of disk seeks is so high that the OS's page cache readahead mechanism nearly always loads the executable in large chunks (maybe the whole binary in one run).

There is some truth to this statement though: when parts of the library are already loaded in memory, the OS doesn't issue a re-read. Over time, unused pages of system libraries will just drop out of page cache and are not read again.

Also related to this argument is the claim that "Less loading latency at the program startup" — which is again not necessarily true in practice. Let's say that a process is launched, which needs to do 50ms of processing and then references a library. If you preload all libraries at execute time, the referenced library could already be in memory because the disk was working in parallel with the CPU. I am not sure how operating systems actually behave in this respect, but the win is not as clear as the article suggests.

If anyone doesn't oppose first, I'll go in and make changes when I find the time. -- intgr [talk] 13:58, 25 August 2008 (UTC)[reply]

Unfortunately I have not found the time and will have limited (at best) Internet access for following several months. -- intgr [talk] 12:54, 24 September 2008 (UTC)[reply]
Additionally: some OSes utilize page prefetching (see prebinding, prefetcher), so libraries (and possibly other files) are speculatively loaded into memory when an application launches -- before they are actually referenced. -- intgr [talk] 13:06, 24 September 2008 (UTC)[reply]
That whole section seems to be assuming that either 1) pages are only loaded when you refer to them when they're not in memory or 2) all pages are loaded immediately. This is not true; as implied in several of intgr's comments, even systems that do "demand paging" in the sense that they can load pages when they're first accessed (or after they've been accessed and pushed out of memory), and don't, for example, load all pages of an executable or shared library at start-up time, can (and, in the real world, do) preload some pages. Should this page discuss the concept of loading pages as needed, regardless of whether some pages might be loaded speculatively, or should it discuss "pure" demand paging where nothing is ever loaded in advance (does any OS out there never pre-load pages?). Guy Harris (talk) 05:03, 20 November 2010 (UTC)[reply]
The exact details of actual demand paging implementations are not important. This is a general concept which is communicated reasonably clearly the way it is. Perhaps the page could stay generalized but mention that "real" demand paging implementations usually do speculative or extra reads to optimize for performance. The trouble is, who's going to go and cite sources for that? 50.47.81.246 (talk) 12:29, 2 October 2011 (UTC)[reply]