Another factor in determining the size of pages is the size of the working set and typical loops inside programs. If a loop stays within one page then all of its addresses will be within that page, causing the program not to page fault since every dynamic address translation will find the page number in the TLB. If the page size is too small, however, the program will frequently go outside the page containing the loop code, possibly causing page faults. Of course, this could happen even if the typical loop is the same size as the page but the loop spanned a page break. In this case, both pages would soon find themselves resident in frames and would continue to sit there until the loop was finished. The solution to these woes is to increase the number of frames that a job is allowed to have at any given time. Yet if the page size is too large, we must run fewer programs at any one time or increase the size of the total memory. |