Defragmenting Your Pagefile

Dear All

Please find the Detailed Procedure for Decrementing PageFile

 Procedure 1

Defragmenting your hard drive regularly is an important part of general system maintenance for Windows  2003 Server  machines, and the Disk Defragmenter tool in Computer Management lets you do this easily. (You can also get to the Disk Defragmenter tool by choosing Control Panel–>Performance and Maintenance–>Rearrange items on your hard disk to make programs run faster.) But what about defragmenting your pagefile? Windows dynamically resizes your pagefile as needed to ensure there is sufficient virtual memory to meet the needs of running applications, and as a result of this resizing, it is possible that your pagefile can become fragmented over time, which can slow performance of your machine. Unfortunately, the Disk Defragmenter tool doesn’t defragment the pagefile, and you might be tempted to buy a third-party disk defragmenter to do this. However, you can save your bucks by following this simple procedure to defragment your pagefile. First, here’s a look at the fragmentation of the C: drive on my Windows 2003 Server machine just before I defragmented it:

After running Disk Defragmenter, the fragmentation of this drive is much reduced:

 


Let’s look at the report generated by Disk Defragmenter to see the condition of the pagefile:
 

 Because of the way Windows 2003 Server  manages the pagefile swapping large blocks of data, the pagefile usually doesn’t become very fragmented, even on heavily used machines. It can become defragmented enough, though, to affect system performance. To defragment the pagefile, we first have to remove the pagefile, then defragment the machine, and finally recreate the pagefile. To do this, start by opening the System utility in Control Panel. (You may have to get there by clicking Performance and Maintenance from the Control Panel and then clicking System.) Then select the Advanced tab, click the Settings button under Performance, select the Advanced tab of Performance Options, and click Change to view your Virtual

Memory settings:
Now select the No Paging File option and click Set. This will disable paging entirely and should also remove the pagefile (pagefile.sys) from the hard drive the next time you reboot your system. (If it doesn’t do this, you can delete this file manually after rebooting. It’s normally found in C:\.)
Reboot your machine, and when Windows comes up, use Disk Defragmenter to defragment the volume where your pagefile was previously (C: drive in my example). Once your system is defragmented, open the Virtual Memory box again, and change the pagefile back to System Managed Size. Then, reboot your machine again. This time, when you run Disk Defragmenter, it should say your pagefile has only one fragment. When I ran Disk Defragmenter on my machine after performing these steps, the result was this:
Note that the pagefile (green area) has been moved to the end of the volume (an added bonus to reduce future file fragmentation). Also, as expected, the report generated by Disk Defragmenter indicates there is now no fragmentation of the pagefile:

 

Advertisements

Leave a comment

Filed under Operating System

Comments are closed.