Paging File

  • Thread starter Thread starter Sid Elbow
  • Start date Start date
S

Sid Elbow

I suspect this is a dumb question but ....

I was doing some defragmenting yesterday and elected to have the
page-file defragged as part of the process (PerfectDisk 8). It needed to
do it at boot time so I re-booted and dutifully sat for 10 - 15 min
while the page file was defragged.

At this point I began to wonder why this was necessary. I thought the
page file was just to offload the system memory when it gets full. Is
there any data in the page file that needs to survive a reboot? Could a
defrag not consist of simply clearing or deleting/recreating it? (Come
to that, couldn't windows itself do that as part of the boot process)?
 
Sid said:
I suspect this is a dumb question but ....

I was doing some defragmenting yesterday and elected to have the
page-file defragged as part of the process (PerfectDisk 8). It needed to
do it at boot time so I re-booted and dutifully sat for 10 - 15 min
while the page file was defragged.

At this point I began to wonder why this was necessary. I thought the
page file was just to offload the system memory when it gets full. Is
there any data in the page file that needs to survive a reboot? Could a
defrag not consist of simply clearing or deleting/recreating it? (Come
to that, couldn't windows itself do that as part of the boot process)?

No, Windows doesn't do this as part of the booting process. Clearing
the pagefile is something that can be done (for security purposes) but
it has to be done when the computer is shutting down, it can take a lot
of time to clear out the pagefile and this can substantially slow down
the shutdown time. Deleting and recreating the pagefile at every reboot
may or would eventually lead to more fragmentation because of the
usually large size of the file, when Windows boots it reads the pagefile
information at the
HKEY_LOCAL_MACHINE\SYSTEM\ControlSetnnn\Control\Session Manager\Memory
Management registry key to determine the location and size of the
pagefile and it will only create a new file if the file is not conform
to the settings in the key.

Having a fragmented pagefile negatively impacts performance during
paging operations, it is best to have the file in a contiguous block or
in as few fragments as possible. It seems to me that Perfect disk may
have taken a bit more time than usual to defragment the file but the
time it takes depends on the size of the file and how heavily fragmented
it was.

John
 
John said:
No, Windows doesn't do this as part of the booting process. Clearing
the pagefile is something that can be done (for security purposes) but
it has to be done when the computer is shutting down, it can take a lot
of time to clear out the pagefile and this can substantially slow down
the shutdown time. Deleting and recreating the pagefile at every reboot
may or would eventually lead to more fragmentation because of the
usually large size of the file, when Windows boots it reads the pagefile
information at the
HKEY_LOCAL_MACHINE\SYSTEM\ControlSetnnn\Control\Session Manager\Memory
Management registry key to determine the location and size of the
pagefile and it will only create a new file if the file is not conform
to the settings in the key.

Yes, I realise Windows *doesn't* clear or recreate the pagefile ... I
was just musing that, if it did, it would/should mean that the pagefile
is always in a defragged state at bootup. As long as the pagefile was
deleted and immediately recreated at the same size and in the same
location (it would have to be a contiguous block I guess) then it
shouldn't affect the fragmentation of other files.
 
Sid said:
Yes, I realise Windows *doesn't* clear or recreate the pagefile ... I
was just musing that, if it did, it would/should mean that the pagefile
is always in a defragged state at bootup. As long as the pagefile was
deleted and immediately recreated at the same size and in the same
location (it would have to be a contiguous block I guess) then it
shouldn't affect the fragmentation of other files.

Actually, now that I think about it, deleting the pagefile and
recreating it is one way that the file can be defragmented but it takes
two reboots to complete the operation, and of course you need enough
contiguous free space to accommodate the file.

John
 
In
John John (MVP) said:
No, Windows doesn't do this as part of the booting process. Clearing
the pagefile is something that can be done (for security purposes) but
it has to be done when the computer is shutting down, it can take a
lot of time to clear out the pagefile and this can substantially slow
down the shutdown time.

Maybe that's why our W2k sp4 machine takes so long to shut down -- is there
any way to determine id this is the case and disable it, please?
 
Back
Top