Defragging the page file?

  • Thread starter Thread starter michalchik
  • Start date Start date
M

michalchik

I have several questions regard defragging the pagefile on a windowsxp
system.

1) Will this help system performance or stability?
2) Will using regedit to go to this key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Memory
Management

and setting the variable "ClearPageFileAtShutdown" to 1 from Zero

effectively defrag my pagefile every time I reboot my computer.

3) Will there be any side effects to doing this and if not why isn't
windowsxp set up this way by default?

Thanks

Michael
 
I have several questions regard defragging the pagefile on a windowsxp
system.

1) Will this help system performance or stability?
2) Will using regedit to go to this key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Memory
Management

and setting the variable "ClearPageFileAtShutdown" to 1 from Zero

effectively defrag my pagefile every time I reboot my computer.

3) Will there be any side effects to doing this and if not why isn't
windowsxp set up this way by default?

Thanks

Michael
1) Yes, defragging the page file will help performance. You need a
special application to do this, however, because a file that is in use
cannot be moved, therefore cannot be defragmented with Windows Defrag.
There is a free application called "Page Defrag" available which can be
set up to defrag those unmovable files at startup.
2) Clearing the page file at shutdown will not defragment it. In fact
it is likely to make the problem worse because the page file will have
to be re-created at boot up and will be placed in the first available
space, which is not usually large enough to hold the entire file.
The way in which I solved my problem with this was to move the page file
to the beginning of another partition on my hard drive, so that it could
not become fragmented.
 
I have several questions regard defragging the pagefile on a windowsxp
system.

1) Will this help system performance

Only if your system's drive is fragmented to the point where lots of other
things would also improve performance.
or stability?

Pagefile fragmentation affecting stability used to be an issue in Windows NT
(the grandfather of Windows XP) back in 1996. As much as Microsoft often
deserve criticism for letting old problems carry on, this has been fixed.
2) Will using regedit to go to this key:

[snipped reg stuff to keep things short and sweet]
effectively defrag my pagefile every time I reboot my computer.

Only if your system drive is defragmented already, so that a large area of
contiguous space can be allocated for the page file on boot.
3) Will there be any side effects to doing this

Sure. It will make your shutdowns slower. Possibly much slower.
and if not why isn't
windowsxp set up this way by default?

Because if you compiled a list of 1000 things that had a profound effect on
Windows XP performance, 'normal' levels of pagefile fragmentation would rank
somewhere in the 800 range.

.... And turning off the setting would rank somewhere in the top 1 of 1000
things that caused slow shutdowns.

A well performing system is all about balance. Balanced sets of hardware,
balanced settings, etc. Anyone who tells you that a magic piece of hardware
or a magic registry hack will solve your problems is either an idiot or that
is what they think you are.
 
The way in which I solved my problem with this was to move the page file
to the beginning of another partition on my hard drive, so that it could
not become fragmented.

How do you do that??

effdee




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0642-5, 20/10/2006
Tested on: 23/10/2006 11:01:53 AM
avast! - copyright (c) 1988-2006 ALWIL Software.
http://www.avast.com
 
effdee said:
How do you do that??

effdee

One way is to move the pagefile to a newly created and formatted partition
as the first file on the new drive. Can't be fragmented that way.

-Frank
 
Those other responses were interesting but are wrong in what youre looking
to do...To defrag the page file is simple,open system properties,set C: drive
to "no page file" click set 2X,close out properties,restart pc.Back in
xp,go to
run,type:cmd In cmd type:CLEANMGR Run on C: Then type:Defrag C: Once
thru,type:EXIT Reopen syatem,set page file to "let system manage" click set
2X,close out.The page file is defragged,sometimes you'll need to do this
every
few days to totally defrag all,however it does work.....
 
Andrew E. said:
Those other responses were interesting but are wrong in what youre looking
to do...To defrag the page file is simple,open system properties,set C: drive
to "no page file" click set 2X,close out properties,restart pc.Back in
xp,go to
run,type:cmd In cmd type:CLEANMGR Run on C: Then type:Defrag C: Once
thru,type:EXIT Reopen syatem,set page file to "let system manage" click set
2X,close out.The page file is defragged,sometimes you'll need to do this
every
few days to totally defrag all,however it does work.....
That can be a problem. Don't attempt it. If you have low memory, your system
may crash forever. (Unless you go into Safe Mode.) Instead, buy PerfectDisk
from Raxco, and defrag the pagefile once every two weeks around using the
Offline Defrag option. (Remember to set the configuration menu correctly!) If
you need help with that, just Google search.
 
1) Yes, defragging the page file will help performance. You need a
special application to do this, however, because a file that is in use
cannot be moved, therefore cannot be defragmented with Windows Defrag.
There is a free application called "Page Defrag" available which can be
set up to defrag those unmovable files at startup.
2) Clearing the page file at shutdown will not defragment it. In fact
it is likely to make the problem worse because the page file will have
to be re-created at boot up and will be placed in the first available
space, which is not usually large enough to hold the entire file.
The way in which I solved my problem with this was to move the page file
to the beginning of another partition on my hard drive, so that it could
not become fragmented.


All the commercial (i.e. $$$) defrag products will
defrag the page file. It is done during the boot process.


This great tool is still free, I think.
http://www.sysinternals.com/Utilities/PageDefrag.html

If you set page file size as a fixed min and max in control panel and
then run one of the above tools you will wind up with a page file that
never fragments. I know that XP is supposed to work best with a
variable size page file, but I did the above with NT and w2k systems
for years.

Never put a PF in a second partition. A second drive is OK
if it's on it's own channel

If XP is now a Real Operating System(tm) you should be able to put
pagefile space on all drives and the OS will always write to the drive
that has the shortest IO queue, but that may be asking to much for a
desktop system.

Actually, page file size and location are not as important as page IO
rate which TaskMan and Perfmon can measure. If your page rate is low
enough then it doesn't matter how fragmented your page file is.
 
effdee said:
How do you do that??

effdee
I first moved everything on that partition to a directory which I
created in another partition, then set the computer to put the page file
on Drive D, and remove it from Drive C. I rebooted the computer, then
checked it to make sure that the page file was the first thing on the
partition, then moved everything back to it. I have O&O Defrag, which
gives you a block map of the content of the drives, so I could use that
to check that the page file was at the beginning of the partition.
 
William said:
That can be a problem. Don't attempt it. If you have low memory, your system
may crash forever. (Unless you go into Safe Mode.) Instead, buy PerfectDisk
from Raxco, and defrag the pagefile once every two weeks around using the
Offline Defrag option. (Remember to set the configuration menu correctly!) If
you need help with that, just Google search.

Why Perfect Disk? I tried it and found it to be anything but perfect.
It created fragments where there had been none.
I like O&O Defrag, which can be set to start defragging before bootup,
so that even the normally unmovable and un-defragmentable files can be
defragged.
 
That registry setting won't do anything to alleviate your problems (if
any pagefile problems even exist!). To defragment the pagefile use
PageDefrag by Sysinternals, as another poster suggested, or go in the
System Properties and set the pagefile size to 0 (zero), reboot and
reset the pagefile to desired size and reboot again. That will recreate
an unfragmented pagefile providing that there is a large enough
contiguous unfragmented area available on the disk to accommodate the
pagefile. DO NOT move the pagefile to another partition on the same
hard disk! That will have a negative effect on performance. For best
performance the pagefile should be on a separate and different disk than
the Windows disk and on a disk controller of its own.

John
 
Replied To [REPLY BELOW]:
-------------------------------------------------------------

: That registry setting won't do anything to alleviate your problems (if
: any pagefile problems even exist!). To defragment the pagefile use
: PageDefrag by Sysinternals, as another poster suggested, or go in the
: System Properties and set the pagefile size to 0 (zero), reboot and
: reset the pagefile to desired size and reboot again. That will recreate
: an unfragmented pagefile providing that there is a large enough
: contiguous unfragmented area available on the disk to accommodate the
: pagefile.

That will create an unfragmented pagefile only if the volume is fragmented, if not
that will result in a more fragmented pagefile. If he is doing that, he should set
the size 0 > Defrag the disk [even if it is already defragged] > Make the pagefile.

--
 
Ayush said:
Replied To [REPLY BELOW]:
-------------------------------------------------------------

: That registry setting won't do anything to alleviate your problems (if
: any pagefile problems even exist!). To defragment the pagefile use
: PageDefrag by Sysinternals, as another poster suggested, or go in the
: System Properties and set the pagefile size to 0 (zero), reboot and
: reset the pagefile to desired size and reboot again. That will recreate
: an unfragmented pagefile providing that there is a large enough
: contiguous unfragmented area available on the disk to accommodate the
: pagefile.

That will create an unfragmented pagefile only if the volume is fragmented, if not
that will result in a more fragmented pagefile. If he is doing that, he should set
the size 0 > Defrag the disk [even if it is already defragged] > Make the pagefile.

I would think that is/was implied in my last sentence?

John
 
Nevermind said:
Why Perfect Disk? I tried it and found it to be anything but perfect.
It created fragments where there had been none.

Why were you running a disk defragmenter if you didn't even have a
fragmentation problem on the disk?

Without wanting to get into an argument about what product is better or
anything like that, how are you measuring that "created fragments where
there had been none."? Is it by using a different product (even the built in
XP one) to 'test' it?

All the different products have slightly different ideas about how to
measure fragmentation, what the best way is to defrag a drive, what the
optimal settings are to mitigate against easy fragmentation in the future,
etc, etc. Hence, what one product calls "defragmented" might not appear so
when the disk is examined with another product.

This doesn't mean that one product is right and the other wrong. It's more
like... well lets say you measure something with a ruler and tell me the
measurement is "20" but not whether you're talking about inches or
centimeters, or something else entirely. Are you "wrong"? No. But can I
actually use that number for anything useful? Again, No.

In other words, you can't reliably measure and compare fragmentation between
two different products. They've both got different ideas of what exactly the
problem is; different ideas of what to measure to diagnose the problem, and
how to do it; what exactly should be done to cure it; and sometimes those
ideas are in direct contradiction to each other.
 
John John said:
Ayush said:
Replied To [REPLY BELOW]:
-------------------------------------------------------------

: That registry setting won't do anything to alleviate your problems (if
: any pagefile problems even exist!). To defragment the pagefile use
: PageDefrag by Sysinternals, as another poster suggested, or go in the
: System Properties and set the pagefile size to 0 (zero), reboot and
: reset the pagefile to desired size and reboot again. That will recreate
: an unfragmented pagefile providing that there is a large enough
: contiguous unfragmented area available on the disk to accommodate the
: pagefile.

That will create an unfragmented pagefile only if the volume is fragmented, if not
that will result in a more fragmented pagefile. If he is doing that, he should set
the size 0 > Defrag the disk [even if it is already defragged] > Make the pagefile.

I would think that is/was implied in my last sentence?

John
The permanent solution would be to just install a new hard drive and move
the pagefile over, taking the work off the system drive. But, it should be on
a different drive controller, or things will happen, like total slowdown.
 
Back
Top