Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page File and Fragmentation 1

Status
Not open for further replies.

MasterRacker

New member
Oct 13, 1999
3,343
US
Assumptions:<br>
<br>
NT4, SP5 - Fixed size paging file originally set up in a contiguous block - Page file set to clear at shutdown through HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management\ClearPageFileAtShutdown = 1<br>
<br>
Question: Does anyone know if this has the side benefit of controlling pagefile fragmentation? <br>
<br>
On the surface you would think so, but I remember hearing once that the pagefile is actually a lot of little files instead of one big one. Therefore I'm wondering if clearing it wipes only data or data and structure. <p> Jeff<br><a href=mailto: masterracker@hotmail.com> masterracker@hotmail.com</a><br><a href= > </a><br>
 
Initially, this can help control paging file fragmentation, but it is not the absolute solution. The paging file becomes fragemented (i.e. inhibiting disk performance) as applications are paged in and out of memory to disk when the initial size of the paging file has been exceeded. Although this may cure the problem after a reboot, it still degrades performance while the machine is up and processing.<br>
<br>
The best way to control paging file fragmentation with any amount of success is to set the Virtual memory maximum and minimum sizes to the same, and be sure that it is at least 1.5 times larger than the physical memory in the machine. Personal preference is to double the amount of physical memory. This will set aside a contiguous block of disk for the paging file, and unless the machine really gets pounded.. should prohibit the paging file from becoming fragmented.
 
I have the page files fixed in size and they are plenty big (usually around 300MB). The problem is that even if the maximum size is never exceeded, the page file will fragment internally. That's the kind of fragmentation I'm hoping to control. <p> Jeff<br><a href=mailto: masterracker@hotmail.com> masterracker@hotmail.com</a><br><a href= > </a><br>
 
I guess I may be a bit confused. If the minimum size of the page file has not been exceeded, how is it becoming fragmented? The pagefile is nothing more than swap space that is allocated for the Kernel to move applications out of memory for temporary storage. The memory manager built into the operating system determines what areas of the paging file are active vs. inactive, what can be written over vs. what cannot.<br>
<br>
The only time I have ever seen degradation of performance has been when a minimum and maximum size for the page file has been specified, and the page file grew beyond the minimum limit and approached the maximum limit. At that time, the file is spread across several physical locations rather than one contiguous block.<br>
<br>
If the minimum size setting has not been exceeded, then the pagefile is nothing more than a big box. You throw the data into the box, and it doesn't matter where it lands, because it is still inside of the box. It only becomesa a problem when it doesn't fit into the box.<br>
<br>
I am curious, are you experiencing performance issues around this? If so, it may be worthwhile to put multiple pagefiles on several drives rather than one drive (if you are using a SCSI raid controller, anyway).<br>

 
I'm not seeing a degradation. This is more something I'm looking at as part of bulletproofing my standard installation. I could be wrong about the internal fragmentation issue. Some information was thrown out in a seminar I was at that even a fixed page file will appear as a single contiguous chunk to NTFS but the memory manager essentially creates a &quot;page file file system&quot; internal to the &quot;black box&quot; and that that is what can fragment. The clear at shutdown flag is a security measure since info can be left behind but what's not clear is whether the page file is cleared at startup. If it is, this issue is moot and page fragmentation would only affect servers that are up 24x7.<br>
<br>
I realize that just because something is said at a seminar doesn't mean it is correct, so I could be working off a false assumption. It does make some sense however, because there is a note with Diskeeper Lite that it can't defrag the page file so there must be some kind of different handling going on. Not a huge issue, just looking for some input. <p> Jeff<br><a href=mailto: masterracker@hotmail.com> masterracker@hotmail.com</a><br><a href= > </a><br>
 
We put all our swapfiles on seperate partitions - therefore no chance of fragmentation. Part of our standard build installs Diskeeper Lite and then after the service packs are set up Diskeeper is run to sort out the rest of the drives before the users get their hand on it.<br>
<br>
Even the standard install routines from Microsoft can cause heavy fragmentation if you have less than a couple of Gigs free on a drive!!<br>
<br>
If you clear the swap file at shutdown then there is a chance, if you are using files on the same drive, that it will be recreated in a fragmented part of the drive.
 
Interesting. My understanding of the clearing operation is that the page file is not removed and recreated, simply that the reserved space is wiped. <p> Jeff<br><a href=mailto: masterracker@hotmail.com> masterracker@hotmail.com</a><br><a href= > </a><br>
 
I agree with MasterRacker. The clearing of the pagefile at shutdown is nothing more then added security. It simply wipes the pagefile area clean.<br>
<br>
Also...How does placing the page file on seperate partitions or drives prevent fragmentation? Why would that work? Simply placing page files on seperate areas would actually only increase preformance. <p> <br><a href=mailto: oneworld@goes.com> oneworld@goes.com</a><br><a href= > </a><br>
 
Putting the page file on a seperate area prevents files geting mixed up with the files space to the page file. If the drive is only used for a pagefile then there is no chance that the file will grow and take over the space between data files on the disk.<br>
<br>
I assume that you have used diskeeper - and seen how the spawfile (yellow) can get badly interspersed with data files system files and fragmented files. I agree that this is a performance issue and cannot defragment the pagefile - but surely this can be minimised by setting buffer sizes on the memory management areas of the operating system?<br>
<br>
<br>
<br>
<p>Mike Hoffman<br><a href=mailto:Mike@mcsch.org.uk>Mike@mcsch.org.uk</a><br><a href= personal technical ramblings page</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top