Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


November 1997

Windows NT Paging Fundamentals


RSS
Subscribe to Windows IT Pro | See More Internals and Architecture Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Nonpageable Data
Not all data may be paged in and out of memory. All data stored in user virtual address space can be paged to disk when not in use, and most data stored in system space can also be paged, but any data that must be stored in a particular area of system space, called the nonpaged pool, cannot be paged. The reason for this limitation is not usually one of performance, but of necessity--some structures created from the nonpaged pool are those used to locate pageable data. (In addition to these pointers, the nonpaged pool includes device driver code and some other data.) The addresses that make up the nonpaged pool vary from platform to platform (i.e., they'll be different on an x86-based system from on an Alpha chip-based system). However, when you boot with the 2GB user and system address split, the addresses are around the middle of the system memory area of the 4GB virtual address space.

The Paging File
It's time to upgrade your 486. Because you're broke and you really need more hard disk space, you upgrade the hard disk first, figuring that you'll add more RAM when you can afford it. More memory would be nice, but you'd rather not scour your hard disk in search of files to delete.

However, when you install the new hard disk with extra space, your system speeds up, as if the idea of having more memory has given new life to your applications. What's going on?

Your system is faster because the additional hard disk space has increased the amount of room available to your system's paging file, the main location (Pagefile.sys) on your hard disk where data not resident in physical memory goes. Although data stored on your hard disk takes longer to get at than data stored in physical memory, an adequately sized paging file is necessary for good system performance. Simply put, if you have a shortage of physical memory, the paging file will swell as the Virtual Memory Manager endeavors to keep data close at hand. If you run out of disk space, no more virtual memory can be allocated, whether a program needs it or not.

This increase in the paging file's size doesn't always mean an increase in performance. If the paging file is adequate, increasing the size won't help anything. However, if the paging file is much smaller than it should be, letting it grow will improve the situation. To improve system performance on a machine that already has an adequate paging file, Microsoft recommends that you add a second paging file on a separate hard disk.

Be aware that you can't delete Pagefile.sys while running NT. If you delete the file while the system is booted to another operating system, NT will re-create the file when you start NT.

By default, NT allocates a paging file the size of physical memory plus 12MB. However, if you don't have enough disk space, the paging file cannot be as big as it should be, as shown in the System Properties applet in Screen 1. You can view your system's information by going to Control Panel, and double-clicking System. The system in Screen 1 has 32MB of RAM, so it should have a 44MB page file. However, because this system's hard disk is crowded, NT allocated only 32MB.

To see the maximum and minimum sizes for the paging file, and the size that NT recommends for your system, click Change to see the Virtual Memory dialog box shown in Screen 2, page 138. This system would perform better with more disk space, because it would let the paging file more flexibly meet the needs of the programs it's running.

Why You Can't Disable Paging
So far, I've explored the relationship between virtual memory and physical memory, defined some key structures involved in allocating physical and virtual memory to processes, and demonstrated how hard-disk space can be nearly as important to system responsiveness as additional RAM. Why page at all? With RAM prices dropping, wouldn't it be better to install a bunch of physical memory on the system and do away with paging?

Well, more RAM would make the system faster, but the reason you can't eliminate paging can be summed up quite simply: fat applications. These days, the programs we run and the files we create are simply too big to be stored in physical memory all at once. If your computer has a lot of RAM installed, the Virtual Memory Manager will have to do less paging, but it's not a reasonable goal to do away with paging altogether.

An easy way to see the relationship between a program's working set and the total amount of virtual memory that it requires is with the Process Viewer utility (Pviewer.exe) included with Microsoft Windows NT Workstation Resource Kit and Microsoft Windows NT Server Resource Kit. Start Process Viewer, and you'll see the dialog box shown in Screen 3. (Although I've selected to view Word 95 for this example, you can also use this tool to view total process and memory details for the system.) This dialog box shows the current working set size, but not much else relating to memory usage.

To get more information about Word's memory usage, click Memory Detail to see a dialog box similar to Screen 4. The important part is in the section labeled Virtual Memory Counts at the bottom of the dialog box. Notice the relative size of the Working Set and the Virtual Size of the application--the Working Set is a little more than one-tenth the size of the entire app's virtual memory requirements! To run this application without paging, you'd need about 53MB of RAM for its exclusive use, and that amount does not include the memory that NT needs to run. Thus, although adding more memory to your system will definitely improve performance, you'll never do away with paging altogether. You're not supposed to--that's why virtual memory was invented.

What if you have 4GB of memory installed? Well, first you must wait until the 1GB SIMMs are available. However, even with this availability, you don't want to disable paging, because Microsoft designed NT to move unused data to the hard disk to conserve space. According to the resource kit documentation, even if a system has demands on its physical memory, about 4MB will remain unused in anticipation of future needs. Less paging might occur, but it doesn't appear that it will be disabled entirely.

A Sense of Purpose
After reading this article, you should have a good understanding of the fundamental concepts of memory management under NT and realize why paging is necessary to the system as it's designed. Although decreasing the amount of paging that your system needs to do will improve performance, Microsoft designed NT to page data in and out of memory to get the most good out of the memory that you have installed.

End of Article

   Previous  1  [2]  Next  


Reader Comments
win 2000 professional

After typing the password of local administrator, its not logging into the local desktop settings. Again its prompting the User authentication box. pls. help

agscare May 18, 2004


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Related Events Windows Internals with Sysinternals Webinar

Deep Dive into Windows Server 2008 R2 presented by John Savill

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement