Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


March 17, 2004

If I have a Windows XP machine that has lots of memory, can I improve performance by removing the pagefile?

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

A. Any program that runs on an Intel 386 or later system can access up to 4GB of RAM, which is typically far more memory than is physically available on a machine. To make up for the missing physical memory, the OS creates a virtual address space, known as virtual memory, in which programs can see their own 4GB memory space. (This virtual address space consists of two 2GB portions--one for the program and one for the OS.) The OS is responsible for allocating and mapping to physical RAM those parts of the program or memory that are currently active.

To work around a machine's physical RAM limitations, a local file known as the pagefile stores pages (in 4KB increments) that aren't in use. (One installation can have multiple pagefiles.) When a program needs to access a page from the pagefile, the OS generates a page fault that instructs the system to read the page from the pagefile and store it in memory. Because disks are much slower than memory, excessive page faults eventually degrade performance. A computer's RAM consists of two sections. The first section, the non-paged area, stores core OS information that's never moved to the pagefile. The second section, the paged area, contains program code, data, and inactive file system cache information that the OS can write to the pagefile if needed.

Although the discussion so far might lead you to believe that Windows stores only active code and data (plus the core OS) in physical RAM, Windows actually attempts to use as much RAM as possible. Often, the OS uses RAM to cache recently run programs so that the OS can start these programs more quickly the next time you use them. If the amount of available free RAM on your computer is low and an application needs physical RAM, the OS can remove from RAM pages of memory used to cache recently run programs or move non-active data pages to the pagefile.

So, if you have a lot of RAM, you don't need a pagefile, right? Not necessarily. When certain applications start, they allocate a huge amount of memory (hundreds of megabytes typically set aside in virtual memory) even though they might not use it. If no pagefile (i.e., virtual memory) is present, a memory-hogging application can quickly use a large chunk of RAM. Even worse, just a few such programs can bring a machine loaded with memory to a halt. Some applications (e.g., Adobe Photoshop) will display warnings on startup if no pagefile is present.

My advice, therefore, is not to disable the pagefile, because Windows will move pages from RAM to the pagefile only when necessary. Furthermore, you gain no performance improvement by turning off the pagefile. To save disk space, you can set a small initial pagefile size (as little as 100MB) and set a high maximum size (e.g., 1GB) so that Windows can increase the size if needed. With 1GB of RAM under normal application loads, the pagefile would probably never need to grow.

If you want to prevent Windows from moving any core OS kernel or driver files to the pagefile, perform the following steps:

  1. Start a registry editor (e.g., regedit.exe).
  2. Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management registry subkey.
  3. Set the DisablePagingExecutive registry entry to 1.

If you want to determine how much of the pagefile is actually being used, you can download Bill James' various pagefile utilities, which are available at this Web site. Among these tools is a WinXP-2K_Pagefile.vbs script that tells you the current and maximum pagefile usage.

End of Article



Reader Comments
”because Windows will move pages from RAM to the pagefile only when necessary”

Not true according to my experience. Windows 95 and 98 only used the pagefile when necessary. But Windows NT, 2000, XP does use it even when NOT necessary. (And probably also Windows 2003.) The OS seem to free RAM by moving pages to the pagefile even if there is large amounts of unused RAM! I usually se about 20-60MB of the pagefile used for this. Is there a way to tell Windows to ONLY move data to the pagefile when needed?

And another related question…
In Windows 95 and 98 there was a setting in system.ini which you could use to specify the maximum size for the filecache. This was very useful because it stopped Windows desktop, i.e. explorer.exe + loads of dll-files being swapped out when doing a normal copy of a large file.

Example:
Computer with 512MB of RAM.
Windows uses 100MB of RAM after startup.
I copy a 1GB file.
Windows uses all available RAM, 512MB for filecache, causing almost everything but non-paged pool being swapped out to the pagefile.
After file copy, trying to open a folder in explorer takes ages to load!

However, if you reserve 128MB of RAM by setting system.ini to:
[vcache]
MinFileCache=4096
MaxFileCache=393216

Now you don’t have any delays double-clicking folders, opening start-menu, or whatever you do on the Windows desktop.

Is there a way to specify how large the filecache may grow in Windows NT, 2000, XP and 2003?

Best regards,
Daniel Mukka Nyberg

Daniel Mukka Nyberg March 18, 2004


Ahhh, but even a small (32MB) page file can seriously slow down your machine, because ANY program doing any kind of disk access (virtual paging included) has to wait ages while the many disk accesses occur, I proved it! My WinXP Pro PC, with 1.5GB of RAM, runs MUCH faster with no paging file, I VERY rarely see low memory warning from TaskInfo, even when running many large applications (http://www.iarsn.com/).

IMHO Microsoft should fix Windows so that it doesn't need to make the huge number of unnecessary paging operations, as seen in TaskInfo.

Infernoz March 20, 2004


Excellent bit of information. Most commendable and definitely a public service. Thanks,

Joe Vazquez April 10, 2004


I just upgraded my workstation to 1GB RAM and had the same question concerning Pagefile.Sys. Now that I know to leave Pagefile alone, how come Windows XP does not clear the RAM once a program has exited? I was using Nero 6 Deluxe & when I was done it still maintained the 700MB of Ram that it initially allocated.

Steven July 08, 2004


Steven said: "Now that I know to leave Pagefile alone, how come Windows XP does not clear the RAM once a program has exited? I was using Nero 6 Deluxe & when I was done it still maintained the 700MB of Ram that it initially allocated."

Windows frees up RAM only when needed and, when available, uses keeps code for recently closed programs in RAM until another program requires that memory space. It does this so that if, say, you closed Nero and wanted to reopen it, it will load very quickly, because it's still sitting there in RAM. Try it: open a program that normally takes a few seconds to load, close it, then repoen it. It'll load much faster the second time. However, if you open it, then close it, then open another program that uses a large amount of RAM, then close it and reopen the first one, it won't be quite so quick.

The bottom line with the Windows pagefile is this: let the system deal with it - it knows what it's doing!

Anonymous User April 03, 2005 (Article Rating: )


Daniel has it right on.

I currenly have 100+ MB free physical memory, yet currently application A is running with 13MB/20MB physical/virtual memory usage and generating 200+ page faults per second! Nothing else is generating page faults. Wth is this application not entirely in physical memory?? And this is WinXP. The constant paging is using a good fraction of the CPU cycles, making any other application that tries to page really slow, and who knows what constant stress it puts on the HD.

I agree that having a pagefile is a good idea, but WinXP just doesn't do it right. Virtual memory has been a performance issue with Windows for years.. how come it still does obviously wrong things? If people have objectively measured performance gains from removing the page file, then that itself indicates a poor implementation.

Anonymous User April 10, 2005 (Article Rating: )


I have 1.2 gigs of RAM and a 200 meg set pagefile on my XP box and still got the "low virtual memory" error. I checked the task manager and see that I have almost 900 megs of free memory but my Office 2003 apps have swallowed up nearly the entire 200 meg pagefile and wants more!!! I'm pretty PO'ed because I'm using a laptop with a slow Hard Drive so I'd rather XP not page out at all, especially if I've got over 800 megs of memory sitting on it's *** doing nuthin. I've tried disabling the pagefile altogether but that will only result in my applications complaining that I don't have a pagefile. Any suggestions (besides increasing my pagefile, I mean). Plz e-mail me tienbo2000@yahoo.com. Thanks.

Anonymous User May 04, 2005 (Article Rating: )


My PC has 1GB of RAM so I disabled Windows paging file and it worked wonderfully. I think it is only suitable for simple applications such as email checking, web browsing... like me. If you are a developer, a designer or a power user I recommend not to disable the paging file. However, why don't you try it and compare the difference?

Anonymous User May 27, 2005 (Article Rating: )


I have a pc with 1 1/2 gigs of ram and it runs awesome without a page file, i also have a pc with 1 gig of ram without a pagefile and that, although it pushes it- sometimes i only have 80-150 mb of ram free- runs much better than with a paging file.

Anonymous User June 22, 2005 (Article Rating: )


I have 1.5 gigs of RAM and I really only use my main machine for computer games such as Battlefield 2, Call of Duty, World of Warcraft and Half Life 2, page file set to off and never once have I ever gotten a page file error. Of course this is only with games, if I were a programmer, or graphic artist, I would most likely use a page file.

Anonymous User June 29, 2005 (Article Rating: )


 See More Comments  1   2 

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...

More fun TechEd 2005 Resources

Kevin points out some more TechEd resources ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Are You Satisfied?

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events 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 Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Microsoft Exchange & Windows Connections event returns to Las Vegas Nov 10 - 13
Connections returns to Las Vegas for this exciting event where each attendee will receive SQL Server 2008 standard with 1 CAL. Co-located with Microsoft ASP.NET, SQL Server, and SharePoint Connections with over 250 in-depth sessions.

Free Online Event! Virtualization:Get the Facts!
Register now and attend this free, live in-depth online conference on November 13 and 20, 2008, produced by Windows IT Pro. All registrants are eligible to receive a complimentary one-year digital subscription to Windows IT Pro (a $49.95 value)!

Check Out Hyper-V Video on ITTV
Watch Karen Forster's interview on Hyper-V's performance on ITTV.net.

Ease Your Scripting Pains with the Flexibility of PowerShell!
Join MVP Paul Robichaux on December 11, 2008 at 11:00 AM EDT as he equips you with PowerShell basics in 3 introductory lessons, each followed by a live Q&A session—all on your own computer!

Latest Advancements in SSL Technology
There are a variety of different kinds of SSL to explore to ensure customer data is kept confidential and secure. In this paper, we will discuss some of these SSL advances to help you decide which would be best for your organization.

PASS Community Summit 2008 in Seattle on Nov 18-21
The don’t-miss event for Microsoft SQL Server Professionals. Register now and you’ll enjoy top-notch Microsoft and Community speakers and more.



Speed Up Your PC!
Try Diskeeper 2008 with InvisiTasking Free Now!

Get Protected -- Data Protection Manager 2007
Protect your virtualized environment with Data Protection Manager

Agent-less Remote Backup Service, Free 30 Day Trial
Award winning remote backup service at a competitive price with no min GB/month. Sign up Now!

ScriptLogic Cartoon Caption Contest
Submit your caption and you will be entered to win $198.42

Order Your SQL Fundamentals CD Today!
Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.

Maximize Your SharePoint Investment: Get Your Data Moving
Watch this web seminar now to learn how to maximize your SharePoint investment! Join us as we take a look at the complex business of securing, accessing and managing vast amounts of information in a global network and various ways to get your data moving.

List Your Products in Our Technology Resource Directory
Don't miss the chance to post your free listing in this comprehensive directory for IT and developer professionals, powered by Windows IT Pro. But hurry! Deadline ends Oct. 9.
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 Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing