Vista, Windows 7, memory use and performance

As hinted previously, I’ve been experimenting with Windows operating systems and hardware for a few years and trying to get the best performance for day to day multitasking and a little gaming.

As promised, this article contains the answers to questions such as:

  • Which Operating System (OS) do I need to use more than 3GB of RAM?
  • 32 bit OS vs 64 bit OS?
  • Which performance tweaks actually work?
  • Which tweaks can reduce performance?

Disclaimer

I’m not a “systems guy”, I’m closer to a systems n00b. If you are a systems person, then I’m sure none of this will be news to you, and you’re probably thinking why is he explaining all this basic stuff? If that’s what you’re thinking, I’ll answer your question with some of my own questions, like where were you when I was looking for simple answers? And where are your articles explaining all this stuff in plain-ish English? And won’t somebody think of the n00bs? (n00bs are people too).
If you consider yourself a systems person and you notice any inaccuracies below, please leave a comment and I’ll update the post, thank you.

Background

  1. There’s no point trying to use more than 4GB of RAM with a 32 bit operating system. Basically, 32 bit Windows systems can only address 4GB, even with PAE (Physical Address Extension) due to driver compatibility issues. And often different internal devices (like your video card) require some of that address space bringing the total addressable RAM that the OS can access down closer to 3GB.
    (sources for this information are inconsistent, but this is the conclusion I reached after much reading, sweating and cursing).
  2. Using a 64 bit OS will allow up to 128GB or RAM available to the OS (as much as you have installed). But a 64 bit OS will cost you RAM also, as all variables are now 64 bits long (instead of 32) this can result in 20-40% more RAM used. So if you are using only 4GB of RAM it’s really not worth switching to a 64 bit OS.
    (see http://www.tomshardware.com/reviews/vista-workshop,1775-5.html)
  3. Some sources will warn against moving to a 64 bit OS because of the unavailability of 64 bit compatible drivers for old hardware. I will say this, 12 months ago 64 bit Vista gave me no end of trouble, but recently, 64 bit Windows 7 has been running very reliably. If you use old hardware or Vista, potential driver issues may be a concern. Otherwise, I think it’s safe to say that 64 bit system users are now first class citizens too and drivers are generally available from all major hardware vendors. It would pay to check first though (especially for any older hardware/peripherals you may be using).
  4. With only 4GB, Vista / Windows 7 fills almost all un-reserved RAM with cached files, but “Physical Memory usage” only reports the amount of RAM actively reserved by applications. This means Windows is putting all the RAM to good use even if it doesn’t appear to be.
    This is visible in Task Manager in the “Physical Memory” area under the “Performance” tab. It displays a high value for “Cached” and low value for “Free” (even though the overall reported “Physical Memory usage” may not be high).
    (see http://www.codinghorror.com/blog/archives/000688.html)
  5. The page file use may seem large (as reported in Task Manager), but it’s not always using that space, that space is only allocated in case active memory needs to be paged. So the page file will always be at least as large as active RAM used, even though data is not being sent to and from the page file.
    This means a high page file value is not necessarily an indication of a performance bottleneck (unless it is much higher than the amount of actively used RAM aka “Physical Memory Usage”).
    (see http://forums.whirlpool.net.au/forum-replies-archive.cfm/929467.html)

Things to do:

  • Lots of RAM is a good thing (4GB is good, 8GB is better)

    RAM is not too expensive these days, so it’s worth shelling out for.
    (see http://www.tomshardware.com/reviews/vista-workshop,1775-12.html)

  • Assign a page file to a different physical hard drive to the system drive

    (see http://www.msfn.org/board/lofiversion/index.php/t12014.html and http://www.tweakxp.com/article37023.aspx)
    Notes:

    • You can use more than one disk for added performance.
    • Don’t use a second drive alone if it is slower than the system drive.
    • Don’t move the page file to a partition of the system drive (very bad for performance).
    • Don’t assign your page file to a RAMDisk as this just reduces the available RAM and creates references back to RAM anyway. Instead, just add more RAM to reduce the necessity to page.
  • Set a static size for the page file (but give it room to grow)

    Whenever Windows dynamically adjusts the size of the page file, the application that requires the extra swap space has to wait. Set a static file size for the page file (initial size = 1.5 times your amount of RAM and maximum size = 2 or 2.5 times your amount of RAM). This way, most of the time the page file will not need to be resized, but can if necessary. Allowing it to resize for situations of abnormally large memory usage may avoid crashing applications (and losing unsaved work).
    (see http://www.extremetech.com/article2/0,2845,2156185,00.asp)

  • Defragment drives that contain page files

    After performing step 3, it’s worth defragmenting the drives being used with system tools, then run PageDefrag because normal defragmentation can’t operate on active page files.
    (see http://technet.microsoft.com/en-au/sysinternals/bb897426.aspx)

  • Trust Vista / Windows 7 to do the job properly

    Task Manager may report only 40% – 60% RAM used yet report a large page file, which can seem counter-intuitive at first. It’s easy to assume that Windows is not managing memory well, that it’s paging memory too soon and must be needlessly thrashing disk I/O when you switch between applications.
    This is not the case, the rest of your RAM is being used for file caching and the large page file usually only represents reserved space (see points 4. and 5. in the Background section).
    (see http://www.codinghorror.com/blog/archives/000688.html)

With 8GB, also do this:

  • Try increasing the FileSystem Memory cache

    This is only worth trying if the “Free” Physical Memory reported in the Task Manager is quite high. Vista / Windows 7 will usually use a lot of memory for caching by default without this tweak (see point 4. in the Background section).
    (see http://www.howtogeek.com/howto/windows-vista/increase-the-filesystem-memory-cache-size-in-vista/)

    • Open up an Administrator mode command prompt by right-clicking and choosing Run as Administrator, or type in cmd into the start menu search box and use Ctrl+Shift+Enter.
    • Enter fsutil behavior set memoryusage 2
    • Restart Windows. (to revert use fsutil behavior set memoryusage 1)
  • Reduce or disable the page file?

    While this is only really feasible for a Vista / Windows 7 system with 8GB or more of RAM and may result in a small performance improvement for switching between memory intensive applications, it will likely cause an application to crash in the event the RAM is ever filled. Remember, it’s always best to have at least 1.5 times your total RAM available for paging and then just let Vista / Windows 7 get the job done.
    (see http://www.tomshardware.com/reviews/vista-workshop,1775-6.html)

Things not to do:

  • Don’t reduce the page file or disable it entirely.
  • Don’t assign your page file to a slow drive or a separate partition of the system drive.
  • Don’t assign your page file to a RAMDisk (this just reduces the available system RAM).
  • Don’t increase the FileSystem Memory cache if your applications max out your RAM frequently.

The wrap up

I hope you found something amongst these tips useful, and I hope it saved you some time.

PS If you are interested in gaming performance, it depends on the game, but to cover all your bases I can recommend all of the above plus Windows 7 (or XP), a quad-core CPU, a fast hard drive (consider a SSD) and a beefy video card πŸ˜‰

Posted in

7 Responses to "Vista, Windows 7, memory use and performance"

Leave a reply