Information AboutPage Size |
| CATEGORIES ABOUT PAGE SIZE | |
| central processing unit | |
| memory management | |
|
Page size refers the size of a memory block used by a processor architecture that supports paged memory. It also represents the smallest possible size of a memory allocation. PAGE SIZE TRADEOFF Processor designers that implement paging often allow two or more, sometimes simultaneous, page sizes due to the global benefits or penalties of using a certain page size. There are several points that can factor into choosing the best page size. Page Table Size A system with a smaller page size uses more pages, requiring a Page Table that occupies more space. For example, if a 232 virtual address space is mapped to 4KB (212 bytes) pages, the number of virtual pages is 220 (20 = 32 - 12). However, if the page size is increased to 32KB (215 bytes), only 217 pages are required. TLB usage Processors need to maintain a Translation Lookaside Buffer (TLB), mapping virtual to physical addresses, which are checked on every memory access. The TLB is typically of limited size, and when it cannot satisfy a given request (a TLB miss) the Page Tables must be searched manually (either in hardware or software, depending on the architecture) for the correct mapping, a time-consuming process. Larger page sizes mean that a TLB cache of the same size can keep track of larger amounts of memory, which avoids the costly TLB misses. Internal Fragmentation Rarely do processes require the use of an exact number of pages. As a result, the last page will likely only be partially full, wasting some amount of memory. Larger page sizes clearly increase the potential for wasted memory this way, as more potentially unused portions of memory are loaded into main memory. Smaller page sizes ensure a closer match to the actual amount of memory required in an allocation. As an example, assume the page size is 1MB. If a process allocates 1025KB, two pages must be used, resulting in 1023KB of unused space. Disk Access When transferring from disk, much of the delay is caused by the seek time. Because of this, large, sequential transfers are more efficient than several smaller transfers. Transferring larger pages from disk to memory therefore, does not require much more time than smaller pages. DETERMINING THE PAGE SIZE Most operating systems allow programs to determine the page size at run time. This allows them to use memory more efficiently by aligning allocations to this size. UNIX and POSIX-based Operating Systems UNIX and POSIX -based systems use the C function sysconf().
Win32-based Operating Systems (Windows 9x, NT, ReactOS) Win32 -based operating system use the C function GetSystemInfo() function in kernel32.dll
HUGE PAGES Some architectures support multiple page sizes -- for instance, Intel X86 supports 4MB pages (2MB pages if using PAE ) in addition to its standard 4kB pages, and other architectures may have similar features. ( IA-64 supports as much as eight different page sizes, from 4kB up to 256MB.) This support for huge pages (or, in Microsoft Windows terminology, '''large pages''') allows for "the best of both worlds", reducing the pressure on the TLB cache (sometimes increasing speed by as much as 15%, depending on the application and the allocation size) for large allocations and still keeping memory usage at a reasonable level for small allocations. Huge pages are, however, not in common use except in large servers and Computational Clusters . Commonly, their use requires elevated privileges, cooperation from the application making the large allocation (usually only setting a flag to ask the operating system for huge pages, though) or manual administrator configuration; operating systems commonly also (sometimes by design) can not Page them to disk. Linux has supported huge pages on several architectures since the 2.6 series. Windows Server 2003 (SP1 and newer) and Windows Server 2008 supports huge pages (under the name "large pages"), but Windows XP and Windows Vista do not. REFERENCES SEE ALSO |
|
|