DEMAND PAGING Virtual memory-the avoidance of thrashing was a major for the 1970s and led to a vari-ety of Complex but effective algorithms.

Source: Internet
Author: User

Computer ORGANIZATION and ARCHITECTURE designing for performance ninth EDITION

With the use of paging, truly effective multiprogramming
Systems came into being. Furthermore, the simple tactic of breaking a process up
into pages LEDs to the development of another important concept:virtual memory.

To understand virtual memory, we must add a refinement to the paging
Scheme just discussed. That refinement was demand paging, which simply means that
Each page of a process was brought in if it was needed, that's, on demand.

Consider a large process, consisting of a long program plus a number of arrays
of data. Over all short period of time, execution is confined to a small sec-
tion of the program (e.g., a subroutine), and Perhaps only one or both arrays of data
is being used. This is the principle of locality, which we introduced in Appendix
4A. It would clearly is wasteful to load in dozens of pages for that process when
only a few pages would be used before the Program is suspended. We can make bet-
ter use of memory by loading in just a few pages. Then, if the program branches
to an instruction on a page does in main memory, or if the program references data
on A page not in memory, a page fault is triggered. This tells the OS to bring in the
desired page.

Thus, at any one time, only a few pages of any given process is in memory,
and therefore more processes can be Mai ntained in memory. Furthermore, time is
saved because unused pages was not swapped in and out of memory. However, the
OS must is clever about what it manages this scheme. When the It brings one page in, it
must throw another page out; the is known as page replacement. If it throws out a
page just before it's about to being used, then it'll just has to go get this page again
Almos T immediately. Too Much of this leads to a condition known as Thrashing:the
Processor spends most of its time swapping pages rather than executing instructions.
The avoidance of thrashing was a major for the area of the 1970s and led to a vari-
Ety of complex but effective a Lgorithms. In essence, the OS tries to guess, based on
recent, which pages is least likely to being used in the .

A discussion of page replacement algorithms is beyond the scope of this chap-
ter. A potentially effective technique is least recently used (LRU), the same algo-
Rithm discussed in Chapter 4 for cache replacement. In practice, LRU was difficult to
Implement for a virtual memory paging scheme. Several Alternative approaches that
Seek to approximate the performance of LRU is in use; See Appendix F for details.

With demand paging, it isn't necessary to load a entire process into main
Memory. This fact has a remarkable consequence:it are possible for a process to be
Larger than all of the main memory. One of the most fundamental restrictions in pro-
Gramming has been lifted. Without demand paging, a programmer must be acutely
Aware of how much memory is available. If The program being written is too large,
The programmer must devise ways to structure the program into pieces that can

Be loaded one at a time. With demand paging, which job is a left to the OS and the
Hardware. As far as the programmer is concerned, he or she's dealing with a huge
Memory, the size associated with disk storage.

Because a process executes only in main memory, which memory is referred to
As real memory. But a programmer or user perceives a much larger memory-that
Which is allocated on the disk. This latter was therefore referred to as virtual memory.
Virtual memory allows for very effective multiprogramming and relieves the user of
The unnecessarily tight constraints of the main memory.

DEMAND PAGING Virtual memory-the avoidance of thrashing was a major for the 1970s and led to a vari-ety of Complex but effective algorithms.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.