Common misconceptions on the pagefile

TexTex Dallas/Ft. Worth
edited July 2004 in Science & Tech
This was cut and pasted from the FAQ section at 2cpu.com. They are lucky to have several posters with extensive knowledge of Win XP internals.

Sorta funny as they also say a lot of the tweaks many of you do from Blackvipers tweaks page are just plain wrong also.

But it may at least may make you rethink some of the common beliefs about the pagefile anyway.


[Q]Do you need a paging file in a 4GB RAM setup ?


- Your Xeons can address 64 GB of RAM, not just 4 GB. (Your chipset might not support more than 4 GB however.)

- The 4 GB limit you're thinking of (largest address given 32-bit addresses) is VIRTUAL address space, not physical (RAM).

- EVERY PROCESS can have up to 2 GB virtual address space, plus there's 2 GB for the OS. So your system's total use of virtual address space can drastically exceed 4 GB. Or even 64 GB.

- Some apps insist on creating what are called "pagefile backed sections" and will therefore fail miserably if you don't have a pagefile.

I think you get my drift here... Yes, you should have a pagefile. 1 GB or so should be fine however. Most apps don't use anything like all 2 GB of their v.a.s., and a lot of what they do use isn't kept in the pagefile anyway.

[Q]Is there anything wrong with Dynamic-sized pagefile setting?

There's nothing wrong with having a dynamic-sized pagefile as long as the default (minimum) size is large enough.

Set the default size large enough that the "PF usage" graph in PerfMon (which is not really the pagefile usage, but never mind that for now) stays below 50%. Then set the max size to at least 2x that. This gives enough free space in the min size file to keep the allocation algorithms working well, and enabling expansion gives you a COMPLETELY free and overhead-less "safety net" in case your needs change down the road.

Many people seem to believe that such a setup will result in the system "constantly expanding and contracting the pagefile." That's a complete myth. The pagefile is only expanded if it has to be, i.e., if the default allocation is not large enough.

[Q]Should I remove the pagefile for higher performance?

Do not remove or cripple the pagefile.

You are NOT eliminating paging by doing so - all you are doing is forcing all paging to be done to pages containing code and mapped files. This cripples the file cache and slows down code execution, among other things.

Sure, experiment all you like. When you're done, put the pagefile back. The balance set management stuff in the NT family was deisgned with the expectation that the pagefile would be there, and it works best when you don't violate its assumptions.

[Q]Shouldn't the pagefile.sys be small until the ram runs out?

No. By default, the pagefile is allocated to 1.5x your RAM size in advance of need. You really don't want to have to be allocating space on the disk for the pagefile every time it needs to be written.

Comments

  • TheBaronTheBaron Austin, TX
    edited June 2004
    thats what i had gathered also
    i'd like to know which blackvipers tweaks you're talking about, Tex
  • TexTex Dallas/Ft. Worth
    edited June 2004
    jeh posts often in the XP section in particular. I understand he co-authored one of the big XP tweaking books or something. He helps analyze core dumps and stuff. (I have been in the buisness and writing software almnost 25 years and I don't even want to think about analyzing a core dump) He has mentioned a number of things actually but it would be best probably for you to actually post to him direct rather then have me screw up as the middle man.

    I think it relates to probvs taht can arise from disabling services viper feels is unneeded but.. whats needed for Viper and whats needed for you or me can vary widely.

    I have a set group of reg tweaks I do in one script as soon as XP is installed. And I use a couple tweak programs but even then I only do it on MY BOX'S not family, or customers etc...

    And I learned the hard way that many of the suggested tweak settings have been to agressive for normal XP computers as it adversely effects some of the programs I install. Your results may differ.

    Many here have thought that having 1 gb of ram meant they do not need a pagefile and I have always argued against that belief. You should tweak the reg to not page unless it needs to and lock the core in etc.. but you should always have a pagefile. My main systems are scsi and having a pagefile on each drive is a huge advantage as it pages to all the drives at the same type almost like a raid system.

    Ever noticed that 90 percent of the guys that say they format and reinstall XP every 90 days are also teh knot heads trying all the goofy tweaks and crap from all over the web? Anyone can post a guide especially a tweak guid on the web. I get a dozen guys a year emailing me and trying to ask a bunch of questions about raid or disk subsytems because they decided to write a big guide on raid. You need to ALREADY KNOW IT to write a guide like that. Tons of crap gets posted as articles on the web by any numb nuts with a keyboard. Doesn't mean its true.

    Tex
  • mmonninmmonnin Centreville, VA
    edited June 2004
    I have done basically what Viper said and it didnt help me system. I think it was clearing the page file at shut down cause it took forever to shut down after I messed with the services.
  • Straight_ManStraight_Man Geeky, in my own way Naples, FL Icrontian
    edited June 2004
    WELL, what you can do is this:

    Kill pagefile in safe mode. Reboot into safemode, run defrag with teh pagefile disabled and nothing else running, then recreate pagefile to a goodly size, and let XP have one heck of a lot more time to boot as it creates a single segment page file. this eliminates a FRAGGED pagefile from tiems when one has been too small and small segments were used to build it up at need dynamically. Size can be a minimum of 2X RAM if box is not bogging, up to 2X that for max to start. There is a process dialog that lets you look at commit levels, in megs, in XP. the tweaking of pagefile guidelines Tex posted are good bases, but as he himself in essence says, you can get best performance between minimum HD use and best running of system by studying system as it runs. I will bet he first derived and then tuned his ideal setup by seeing what his particular system actually does in use. That is indeed what I will do and have done also here, for my boxes, and have been known to try and run as many of the programs on the client's boxes as possible and look at the actual commit to see what I need for a first-pass max and minimum.

    In 98 SE a fixed swapfile large enough not to let the box hang even under extreme load was more stable, the built-in defragger never defragged it and it could get to a point that the segment linkages went to places all over HD (I have seen later linked to page sequence segments physically EARLIER on HD when one thinks of HD search order) with 98 and SE and back after a long time of use. XP tends to start larger by default and is less often going to get a very fragged pagefile than 98 SE did. In fact one reason I liked speeddisk on pre 2000 systems was that it could in fact optimize the swapfile.386 file which was the paging\"swap" file name for Windows pre 2000 that was not NT. Speedisk never was able to defrag a pagefile.sys file in consumer versions of Norton Utilities or Ssytemworks in consumer versions.

    BUT, when you tell it no pagefile, do NOT even consider loading the box with any major optional process load while it has none as it then refuses to page to and from HD at all and you are more likely to get RAM violates and BSODS with hardware that is totally fine-- and possibly get partly written data and lack of valid driectories and creeping corruption due to sudden failure leaving things unwritten or journalled wrong.

    Thanks for a good thread topic and good info and warning, Tex. :) SCSI is kinda a strange beast to set up a paging file strategy for. IF you can dedicate a physical HD and need a huge paging file, putting it on one HD that data flow is about 80-90% used for just paging to and from page file might yield actual best results, simply because if the drive used to write to pagefile part is busy on an attempt to read same part, the app resume or thread resume might be slower that way. I do not know if that would offset your idea that with multiple parts on multiple volumes and physical mechs you get a better tuned write time or not.

    History Note: On 98 SE I got little advantage even trying this last idea of spreading a swap file unless one or both of two things occured also-- the HD with first part was often busy at swap read and write times, or not enough physical space was available on HD with first part on it to allow swap file to grow enough for system needs when apps were included in in resource demand calcs. If I had one HD faster than a second HD on one box, I always put the swap on the fastest physical HDs' PRIMARY PARTITION even if I had to rebuild the partition structure for the faster HD with Partition Magic or some such tool.

    John.
  • profdlpprofdlp The Holy City Of Westlake, Ohio
    edited June 2004
    BlackViper's guide is a great place to start - as long as you keep track of what you disable or change to manual. I printed out his guide and added my own notes for specific circumstances, as in broadband vs. dialup, networked vs. solo, etc.

    It's not the type of thing you'd send to a novice and say "here ya go". More of a guide for people who've been around the block and know how to pick and choose for their own particular needs.
  • TexTex Dallas/Ft. Worth
    edited July 2004
    http://forums.2cpu.com/showthread.php?s=&threadid=10014&perpage=30&pagenumber=1

    Like a 6 page forum thread of posts but the knowledge contained within after really digesting it is worth a read for anyone tuning their pagefile or system cache. You have to sift through the arguements but a lot of really really good info in one place.

    Tex
Sign In or Register to comment.