Paging File

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)?
 
J

John John (MVP)

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
 
S

Sid Elbow

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.
 
J

John John (MVP)

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
 
H

h.stroph

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?
 
J

John John (MVP)

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

Similar Threads

Paging File gone? 7
Paging file 1
Paging File problem 4
paging file 6
Removing old paging file 1
Problem Defragging Large File 43
Paging File Question 3
Paging File Error 9

Top