As a program runs, it commonly uses only a small percentage of its pages at any given time. This is called its working set. Suppose, for example, that the program shown in Fig. 12.2.1 from only two pages and runs code out of only one page, except for an occasional reference to a section in the other pages. We would say this program had a working set of 3 pages. If real memory is big enough to hold the working set, then the program will execute smoothly. However, if real memory is too small, then a condition known as thrashing occurs where the program frequently brings in pages from disk, only to use them a little while and throw them out. This is a terrible situation since disk accesses are often 20,000 to 100,000 times slower than main memory accesses! |