Bill said:
If you do not allow Windows to manage it, and fix the
size, it'll stay put. It's not a given that it
has to move, or that it has to fragment.
I don't think my pagefile has been fragmented in the
last five years.
[snap]
I don't believe I have the size set but if I wanted to defrag it. I would
rename it. Reboot and defrag it. Then go back to linux and erase the new
pagefile.sys and rename the old pagefile to "pagefile.sys" That's one way to
defragment it. It shouldn't need done again.
Bill
Size of, or data within, Pagefile is constantly changing.
I perhaps didn't say it well when I said "pagefile.sys gets recreated
all the time," but that's what I meant.
You will have to defrag it every few seconds.
Yes, so defragging it is useless, as I said.
The Windows Defragmenter report is capable of reporting
whether the pagefile is in more than one segment or not.
Pagefile fragmentation
Pagefile size = 2.00GB
Total fragments = 1
And mine has read out that way, constantly. It never
fragments (because I don't allow Windows to manage the
size, and the size is fixed). The pagefile stays at
the same starting LBA, and it is never fragmented.
It is one continuous 2GB set of LBAs.
*******
The pagefile is used in 4K chunks. And has a management
scheme, to allocate space, keep track of what is used.
Keep track of what remains free or was recently freed up.
A typical situation, when a program is exited in WinXP, is
paged out portions of the program, they can now be released.
This causes what look like fairly random areas of the pagefile
to be visited. Giving the impression of "fragmentation". But it's
the kind of fragmentation you get in a memory allocator (malloc),
where allocated pages are freed in a relatively random
fashion, leading to inefficient head movement on regular
hard drives used for paging duty.
I've seen 30 second to one minute delays, as the "pagefile"
and paged out stuff, unwind. (This is an observation for WinXP,
the topic of this newsgroup.) And the duration is not due to
the quantity of stuff being handled - it's the random head
movement for the hard drive to visit all those locations.
An SSD handles this pattern with ease, as seek time is 20us to
100us, instead of 10 milliseconds for the hard drive head
assembly. Similarly, if you've installed a RAMDisk that
doesn't use OS-managed memory, that unwinding of the pagefile
is quick and buttery smooth. Only mechanical hard drives make
that look like sheer hell.
After the next reboot, the control of the pagefile is
starting over again, and the unwinding process will be
relatively quick for small allocations.
Later OSes do this a bit better. If you need a way to
torture a later OS, try the 64 bit version of CHKDSK,
and do a CHKDSK on a partition with a lot of files.
Then watch Task Manager and the memory usage display.
Paul