1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

How do I defragment swap/paging file?

Discussion in 'Windows XP' started by johngarnold, 2005/08/06.

  1. 2005/08/06
    johngarnold

    johngarnold Inactive Thread Starter

    Joined:
    2002/01/14
    Messages:
    34
    Likes Received:
    0
    Recently after defragmenting my C: drive I noticed that there appeared to be a lot of disk space taken by fragmented file(s). This file(s) were not listed in the 'report' at the end so I suspected it was the swap (paging) file. I then set my swap file to ZERO (yes I know it is not recommended) and run defrag again and ALL of the fragmented (file) disappeared. I then reinstated my swap file and lo and behold it was created with even MORE fragments. I also noticed that some files occupy a space near the 'end' of the disk with LOTS of unoccupied space betwen the 'front' of the disk and where those files reside.
    Is there some way of defragmenting files so that most if not all files are moved together so that there is no unoccupied space between files. I have downloaded and run some TRIAL non Windows defragmenting programs which did not seem to improve the situation very much.
    I am sure if I can eliminate unused space between files then I can create a NON fragmented swap file.
    Thanks in advance.
    John
     
    Last edited: 2005/08/06
  2. 2005/08/07
    PeteC

    PeteC SuperGeek Staff

    Joined:
    2002/05/10
    Messages:
    28,896
    Likes Received:
    389
    Whatever you may read elsewhere you cannot defragment the pagefile :) The solution to a pagefile spread all over the disk is either to use a fixed size pagefile or, as I do, have a dedicated partition for the pagefile.

    You clearly know how to navigate to the dialogue box to set the pagefile (virtual memory) ....

    Highlight the drive > click on Custom and set the max and min sizes to the same value (screenshot). MS recommended size of the pagefile is 1.5 x RAM, which is a bit excessive if you have a lot of RAM installed (2 GB on my m/c), but works OK.
     

  3. to hide this advert.

  4. 2005/08/07
    Christer

    Christer Geek Member Staff

    Joined:
    2002/12/17
    Messages:
    6,585
    Likes Received:
    74
    Norton Ghost actually defragments the pagefile as a "side effect" of restoring an image!

    Christer
     
  5. 2005/08/07
    Welshjim

    Welshjim Inactive

    Joined:
    2002/01/07
    Messages:
    5,643
    Likes Received:
    0
    johngarnold--
    FWIW--The following article says the only way to defrag a swap file is to delete it before the defrag
    http://www.pcmag.com/article2/0,1759,1819103,00.asp
    (go to page 4 by clicking Next and then to the fourth paragraph under Reduce Hard Drive Growing Pains)
    See the image in PeteC's post. There is an option to check "No paging file ", and you then click Set before defragging the drive. That deletes the swap file. The article tells you how get a swap file back after the defrag is completed.
     
  6. 2005/08/08
    Top Dog

    Top Dog Inactive

    Joined:
    2002/01/07
    Messages:
    102
    Likes Received:
    0
  7. 2005/08/09
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    Top Dog - that is an excellent utility and will defrag all the registry hives when you reboot if you've set it to do so. I used it heavily with NT4 and 2K.

    I loaded it on XP since it works fine with the OS but it never found those files to be fragmented. That led me to believe that XP can handle them real-time although I'm not tech enough to know how.
     
    Newt,
    #6
  8. 2005/08/09
    Mastertech

    Mastertech Inactive

    Joined:
    2005/02/08
    Messages:
    2
    Likes Received:
    0
    Defragmenting the Pagefile as well as the rest of the drive improves performance. I highly recommend Pagedefrag as well. Never disable the Pagefile. Once a Pagefile is defragmented it cannot become fragmented again unless you manually resize it or move it. You can get more info here
     
  9. 2005/08/09
    PeteC

    PeteC SuperGeek Staff

    Joined:
    2002/05/10
    Messages:
    28,896
    Likes Received:
    389
    I think the argument here centres around contiguous and non-contiguous pagefiles.....

    If a page file is of a fixed size it will remain contiguous, the file is not fragmented - if it it is allowed to expand and contract dynamically it will be non-contiguous, the file is fragmented, but the chunks of code therein ??? - no doubt they may well become fragmented as in any other folder, but maybe less so if there is plenty of fixed pagefile space? JMO

    FWIW - I have used Diskeeper Pro on several computers for several years and have no complaints about it's performance. I have a small fixed size pagefile on the C: drive for memory dumps and a larger fixed size pagefile on a dedicated partition - the latter is excluded from Diskeeper. With 2 Gb RAM on board I rarely see more than 100MB of pagefile used, more like 10 - 20 MB as shown by Bill James' Pagefile Monitor
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.