Friday, 20 September 2013

Defragmenting Pagefile

Greetings, Audience.

Have you encountered the situation where you wanted to defragment your hard disk, but somehow the 'unmoveable' files have become so fragmented and it cause your defragmentation effort to have pretty much no effect?

No worries. There's a cure for that. However, you might need additional hard disk to make this happen.

Lets say, your disk fragment look something like this:


The unmoveable files, marked as green, are actually your pagefile. It is used as temporary storage to swap the information from your RAM. Those file are created on startup, and cannot be moved while the Operating System is on. When they become too fragmented (as in the image), it will be hard to properly defrag the rest of the file in that disk.

To prevent this from happening (or, say, fix it if it is already happened), i would recommend you to prepare an empty disk partition, with the size of twice of your RAM. Meaning, if your RAM is 8 Gigabyte, the empty partition should be 16 GB. This partition will be used as dedicate storage for pagefile.

Note that this guide will be based on Win XP. Newer OS should be quite similar to this.

To reassign the pagefile to the empty partition, go to the 'System Properties' (right click My Computer, and click properties).
In the Advanced tab, click the 'Performance' setting (1). It will pop the performance option. In that window, go to the Advanced tab, and click the 'Change' button under the virtual memory (2).

A new  window will pop up. Here, you can set the size and location of your pagefile.
By default, the pagefile will be under your OS partition (usually C:). Select it and set to 'No paging file'. Then, select your empty partition, and set it to 'Custom size' or 'System managed size'.
If you chose to make it custom, set the initial size to the size of your RAM, and the maximum size to the size of that partition (at most twice the size of your RAM)..

Once you have done that, reboot the PC and you can see the difference. The image below shows the OS partition without the pagefile. Note that there is no more 'green' block.


And this image below show the new partition dedicate for the pagefile:

Take note that you should not save or put any file into this partition. That would beat the purpose of having a dedicated partition.

If you want to do this, make sure you do it properly. Try not to resize your existing partition since it might cause the data to corrupt. Best to have someone who can take action in case things go wrong on your side while you're doing this.

So, that's all for now. Cheers. ^.^

No comments:

Post a Comment