Paging file FACTS, not fables

A

Adam Albright

Seems like another pissing contest is under way. So typical in this
goofy newsgroup. For those more interested in facts, keep reading.

Q. What is a Paging file?

A. An area on a hard drive dedicated by and controlled by Windows
to allow swapping of memory pages in and out of RAM (memory). This
is called virtual memory.

Q. Can you have more than one paging file?

A. Yes, you can have up to 16 paging files totally up to 64 GB
of space, but of course that would be silly.

Q. Can you control how Windows uses multiple paging files?

A. No! That is totally up to Windows.

Q. So if I set up multiple paging files on different physical hard
drives how does Windows decide which one to use?

A. Windows will automatically choose the page file on the drive with
the least activity AT THE MOMENT the swap is made. So where any
data goes at any point in time isn't controllable by the user and
it would be an impossible task to do if you could since we're
talking milliseconds.

Q. Is there any practical advantage to having multiple page files?

A. Generally no. What you should concern yourself with instead is
picking the fastest of your hard drives and then devote a partition
on it for your paging file. Ideally, NOT your root drive since it's
overhead is usually pretty busy just doing normal Windows tasks.
Better yet in extreme conditions if your motherboard has multiple
disk controllers and you don't use one for external drives or other
duties devote a channel to your paging file and nothing else.

Q. Can I move my Paging File?

A. No. Not in the normal sense you move files. All a paging file is
a memory dump consisting of memory pages, which isn't in human
readable form. Instead you kill the current paging file you have,
meaning you tell Windows you want no paging file, skip past the nag
screen, then follow the prompts to move to a new hard drive. In
effect you're making a NEW paging file on a different drive.

Q. How big should a Paging File be?

A. The general rule of thumb is one and a half times the size of your
installed memory (RAM). You can also decide to let Windows manage
the paging file in which case it grows and shrinks in size
depending on load or you can set minimum and maximum limits. The
best way to see which method works best for your particular needs
is experiment!

Q. Is there a maximum size to how large a paging file can be?

A. Not sure if it has changed in Vista. In XP the maximum size of
a paging file was 4095 MB, unless you did a Registry hack.
More details here:

http://support.microsoft.com/kb/237740

Q. How do I know if I should mess with my current paging file
setting and should I worry I will mess something up?

A. Good Question. Finish reading this answer and you'll be on
your way to getting your official propeller cap all real
geeks wear.

To understand your paging file you first need to understand what a
"page" of memory is. In order for anything to happen in your computer
a bit of code needs to be brought into memory. Since you can only have
X amount of RAM, Windows will swap out what is currently in RAM and
place it in virtual memory (a space on your hard drive, here after
referred to as the paging file). This is done a "page" at a time,
which simply means a range of memory is read, typically in 4,096 byte
gulps. Then Windows has room to bring into RAM what it needs to
execute the task you told it to do. In complex tasks Windows can swap
memory pages hundreds of thousands of times an hour.

When your computer locks up one of the most common causes is a page
fault. That simply means two handles to some processes tried to access
the same memory space at the same instant in time. Bad news, Windows
will freak and often crash when that happens.

Since getting something from memory is way faster than need to go out
to a hard drive and get in virtual memory, your paging file regardless
what you're asking Windows to do will run way faster if it doesn't
have to swap memory pages so often.

Since doing so is a big hit on performance there is a name for the
process when Windows needs to swap a memory page. These are called
page faults. Bad name, since it sounds like an error, but it is just
an interruption. Because of that Windows keeps track of page faults.

You can see how many page faults you are getting by starting Task
Manager and looking under the Processes tab. As your applications are
running watch the Page Fault column. The higher the number the more
times that application caused Windows to swap a page in and out of
RAM.

By running some test doing the EXACT same task over and over you can
get an idea if or not resizing or moving your paging file helps or is
just a waste of time.
 
Q

Qu0ll

Seems like another pissing contest is under way. So typical in this
goofy newsgroup. For those more interested in facts, keep reading.

<snip>

Thanks for the info.

I have 8GB of RAM. By your reasoning I should have at least 12GB of page
file but at the same time you say only have one page file and that the
maximum size is 4GB. Obviously not all of these requirements can be met in
my case. Is the best resolution to have 3 x 4GB page files?

Also, you say to put the page file(s) on your fastest disk. If your fastest
disk is the one with the system partition does it make any sense to put the
page file(s) on the same disk but in a separate partition or does it need to
be a totally different physical disk?

--
And loving it,

-Q
_________________________________________________
(e-mail address removed)
(Replace the "SixFour" with numbers to email me)
 
M

Mike

Qu0ll said:
I have 8GB of RAM. By your reasoning I should have at least 12GB of page
file but at the same time you say only have one page file and that the
maximum size is 4GB. Obviously not all of these requirements can be met in
my case. Is the best resolution to have 3 x 4GB page files?

Check and see what it has now. The default is for Windows to handle it
automatically.
Also, you say to put the page file(s) on your fastest disk. If your fastest
disk is the one with the system partition does it make any sense to put the
page file(s) on the same disk but in a separate partition or does it need to
be a totally different physical disk?

To see any speed increase it needs to be a separate disk. A separate
partition on the same drive will probably give slightly slower results
due to head travel time. Not that you would probably notice unless you
precisely measured it, but the potential is there.

In general, it's best to leave it alone and let Windows manage it.

Mike
 
C

Chad Harris

AYK-- a lot of XP MSKBs do apply to Vista, and they aren't in any hurry even
to update them with Vista lables reminding me a little of the goofey
byzantine Symantec KB articles, one more reason why I kicked Norton
products to the curb long ago--that and there erratic uninstalls and erratic
performance and stilted manual update requirement unless you want to wait
once a week.

I have found one thing to be true of RAM and Vista and XP. Once you have
even 1 GB of RAM, all the adjusting of RAM and Virtual memory doesn't seem
to make a difference. And although I do move my paging file to simply
another drive than the system drive because so many Windows experts have
recommended to do so, I haven't seen a lot of difference.

Let me know if you can demonstrate on any of your boxes that adjusting
Virtual RAM or moving the page file really makes a significant difference in
performance when the box has over one GB of RAM--and I expect most of yours
do. I haven't been able to demonstrate that to myself, and I've been trying
over the years.

Check out:

RAM, Virtual Memory, Pagefile and all that stuff
http://support.microsoft.com/kb/555223/en-us

From Ed Bott in Vista Inside Out:

"Should you get involved in paging file management and how?"

"If you have more than one drive, moving the paging file to a fast drive
that is not your system drive is a good idea. Using multiple paging files
that are split over two or more physical discs is an even better idea,
because your disc controller can process multiple requests to read and write
data concurrently. Don't make the mistake of creating two or more paging
files using multiple volumes on a single physical disc, however.

*If you have a single hard disc that contains C, D, and E volumes, for
example, and you split the page file over two or more of these, you may
actually make your computer run more slowly than before.* In that
configuration, the heads on the physical discs have to do more work, loading
pages from different parts of the physical disc sequentially, rather than
loading data from a single contiguous region of the hard disc.

If your are short of hard disc space, you might consider setting a smaller
inital page file size. You can use a handy script from Windows MVP Bill
James to monitor current page file usage and session peak usage. This tool
free at http://billsway.com/notes_public/WinXP_Tweaks/ was written for
Windows XP but works fine for Vista."

Read more in Ed Bott's book at 747.

This is the theory, although as I said, I haven't seen much difference on a
box that has 1GB of RAM or more.

The paging file is a way to hand over more memory when programs demand it.
Windows tries to solve this by taking a snaphsot of a memory chunk and
tossing it to the HD so the demanding program can use it. The program it
borrowed from is going to demand that memory back, and when it does, a hard
page fault happens. The snapshots are virtual memory that sits in the paging
files. If your virtual memory is on the same disc as your programs, then
Windows has to strain or fly around like a chicken with its head cut off to
keep all the programs going. Bringing the snapshot into memory may force
another snap shot, and another, and so on.

If the paging file is on another disc, that doesn't have your programs,
windows can run faster if it juggles two discs at the same time--provided
you have the room.

You can use the Resource monitor to monitor how many page faults you're
getting--and if you're getting several--say a couple dozen hard faults per
second--you should consider putting paging files on two or more fast hard
drives if you have them.

http://windowshelp.microsoft.com/Windows/en-US/Help/b9dca7ff-88b6-4d8b-9ca2-49cff3cd1c951033.mspx

If you disable the paging file and don't have enough RAM, your programs will
refuse to load and will crash. If you stick to the 2GB minimum, you won't
have problems. If you don't, you'll get out of memory messages, and the
programs could crash and in some of them you could lose your work.

If you have over 2GB of RAM on your box, you can consider disabling the
paging file. If not, forget it. This will cause faster memory access and
management than is physically possible for your RAM.

CH
 
C

Charlie Tame

Chad said:
AYK-- a lot of XP MSKBs do apply to Vista, and they aren't in any hurry
even
to update them with Vista lables reminding me a little of the goofey
byzantine Symantec KB articles, one more reason why I kicked Norton
products to the curb long ago--that and there erratic uninstalls and
erratic
performance and stilted manual update requirement unless you want to wait
once a week.

I have found one thing to be true of RAM and Vista and XP. Once you have
even 1 GB of RAM, all the adjusting of RAM and Virtual memory doesn't seem
to make a difference. And although I do move my paging file to simply
another drive than the system drive because so many Windows experts have
recommended to do so, I haven't seen a lot of difference.

Let me know if you can demonstrate on any of your boxes that adjusting
Virtual RAM or moving the page file really makes a significant
difference in
performance when the box has over one GB of RAM--and I expect most of yours
do. I haven't been able to demonstrate that to myself, and I've been
trying
over the years.


I tend to agree, bur it may make a big difference how the machine is
being used. For me I think let Windows manage it is as good as anything
else.
 
C

Chad Harris

I understand Charlie, but if you look at my post on the thread I pointed out
some pros and cons that I think explain why many people give your advice. A
lot depends on the type of HD, and the amount of RAM, so adjusting the page
file manually should be done when it's appropriate.

Sometimes, you can improve your situation by managing the paging file
yourself, and anyone who says letting windows manage it under all conditions
is over simplifying and robbing you of some options to make your system more
stable and perform faster.

The most complelling argument for setting paging file size and limit
manually
is to eliminate growing of the paging file when it is set by the system aka
"windows manages it." When the system manages it, it will monitor the size
of the paging file, and will then automatically make it larger when needed.
This causes two problems.

First, it will cause a noticeable delay for all apps running on your
box,because the pc has to expand the paging file and this is a hard disc
intensive operation. Second, allowing the system to grow and shrink the
paginf file causes fragmentation errors. Your paging file should not have
file fragments, and this is another reason to let one of the better
defraggers like Perfect Disk or Disk Keeper defrag the paging file at boot.

Before defragmentation can be successful however, the paging file needs to
have a constant size. If the paging file is allowed to grow frequently, and
the defragger has no clue how much, the defrag utility can't put the file on
the hard drive on a place where it won't get fragmented, as in the case
where you set it to a constant size.

There can be disadvantages to setting paging file size manually.

Size is important. If you set the paging file and say it takes up 5GB, that
is lost disk space. When you set the file siz manually, you are setting a
limit that your pc can't exceed. If you run a memory intensive app, and
your limit is too low, the paging file will fill up, and programs could
crash and you can get out of memory errors just as when you disable a paging
file if you have less than 2GB of RAM.

CH
 
D

Dale White

I have 8GB of RAM. By your reasoning I should have at least 12GB of page
file but at the same time you say only have one page file and that the
maximum size is 4GB. Obviously not all of these requirements can be met
in my case. Is the best resolution to have 3 x 4GB page files?

Also, you say to put the page file(s) on your fastest disk. If your
fastest disk is the one with the system partition does it make any sense
to put the page file(s) on the same disk but in a separate partition or
does it need to be a totally different physical disk?


I think the first question you have to answer yourself is how much RAM do
you need ? If you're only using 6GB of the 8GB, then having a 12GB file is a
waste of space. I'm guessing since you have 8GB, you must be doing some head
duty lifting. Do you know how far beyond 8GB you are exceeding ? Obviously
if it's below 4GB, then a single 4GB file should be enough. If you really
wanted, you could do a simple cheap hardware RAID 0 and place the pagefile
on that, if absolute speed is the desired effect.

I think most normal users could get by with a 2GB pagefile, if they had 2GB
of ram. If you really were at a place where you need to use more thna
100-200 MB of the pagefile, it would be time to get more ram, whichis by far
faster and cheaper.

Your case is a bit extreme.
 
A

Adam Albright

I think the first question you have to answer yourself is how much RAM do
you need ? If you're only using 6GB of the 8GB, then having a 12GB file is a
waste of space. I'm guessing since you have 8GB, you must be doing some head
duty lifting. Do you know how far beyond 8GB you are exceeding ? Obviously
if it's below 4GB, then a single 4GB file should be enough. If you really
wanted, you could do a simple cheap hardware RAID 0 and place the pagefile
on that, if absolute speed is the desired effect.

I think most normal users could get by with a 2GB pagefile, if they had 2GB
of ram. If you really were at a place where you need to use more thna
100-200 MB of the pagefile, it would be time to get more ram, whichis by far
faster and cheaper.

Your case is a bit extreme.
I would tend to agree. The only advantage I heard of to have multiple
paging files scattered across various hard drives would be if you're
doing something very intensive and hopefully Windows would be smart
enough to swap to the drive that wasn't doing anything else at the
exact point in time it made the swap. Even if it did I don't see any
real gain unless the task took hours and then maybe you would shave
off a few seconds. Ditto for having a huge paging file if you have
that much RAM. It seems overkill.

What the OP does with so much memory may shed further light.

From my experience I've played with between 1 to 2 GB of RAM and do
intensive video editing with Vegas. During the rendering (publishing)
phase where the file is actually getting written out in final form if
you watch under Task Manager you'll see extremely high counts for page
faults, well into the millions if the job takes overnight suggesting
that Vista is swapping like crazy while looking at a gizmo on the
desktop that shows a real memory usage the gage never gets above
55-60% which suggest Vista always reserves a good chunk of RAM.

So... my wild guess is no matter how much RAM you have installed, no
matter how fast your FSB or CPU and regardless what task you're doing
Vista is still going to swap memory pages like mad IF it needs to
bring bits of internal code back into memory to process the task. In
other words even if there is plenty of RAM and it isn't used, Vista
like XP before it will still shuffle a lot of memory pages for reasons
only know to itself. Maybe we should ask Harry Potter.
 
C

Charlie Tame

Yes I agree, I merely mean that with my configuration and normal usage
it works for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top