Homework 4 - Virtual Memory

FAQ

Updated: Apr 29, 2010

Running out of physical pages?

You are probably attempting to allocate a full tree for your pagetables, i.e. 1 page for the top level (the PageDirectory), and 1024 more pages for the second level (the PageTables). You should only allocate the top-most level of the tree, a single page, when the address space is created. The lower levels should be allocated only as needed, one PageTable at a time. This is, after all, the entire point of a tree-structured pagetable: to reduce the overhead associated with a flat pagetable (1024*1024 page table, entries stored on 1024 pages) to a more reasonable amount (one PageDirectory, plus as many PageTables as are actually needed).