Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Windows 7: how to determine if the page file is fragmented

    Does anyone have a simple method, or know of a utility, to determine if the Windows 7 page file (= swap file) is composed of more than one fragment (= extent)?

    Thanks!
    BATcher

    Time prevents everything happening all at once...

  2. #2
    Gold Lounger Roderunner's Avatar
    Join Date
    Dec 2009
    Location
    Scotland.
    Posts
    3,462
    Thanks
    16
    Thanked 216 Times in 183 Posts
    I used this in days when I was running Vista & XP. Never tried it on Win7 PageDefrag.zip
    O wad some Power the giftie gie us, to see oursels as ithers see us!

  3. #3
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    3,760
    Thanks
    26
    Thanked 424 Times in 338 Posts
    MyDefrag will give a graphic display of the pagefile (shown in red - unmovable) and it's easy enough to tell whether it is contiguous or not.

    That being said, I don't use a pagefile on my desktop or laptop. I have 16GB RAM on the desktop and 8GB RAM on my laptop. And all of the warnings about a memory dump, etc. are for naught. Windows will write a memory dump file on the root of C drive in the absence of a pagefile. In my slicing and dicing of Windows installations, I have created many a memory dump (I just restore a drive image and start over, so the memory dumps don't really mean much to me).
    Create a fresh drive image before making system changes, in case you need to start over!

    "The problem is not the problem. The problem is your attitude about the problem. Savvy?"—Captain Jack Sparrow "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware.
    Unleash Windows

  4. #4
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    3,760
    Thanks
    26
    Thanked 424 Times in 338 Posts

    Prevent fragmented pagefile

    For those who do use a pagefile, there is a fairly simple means of preventing pagefile fragmentation. First, in "System Properties" "Advanced" tab, click on the "Settings" button under the "Performance" header. Click on the "Advanced" tab in "Performance Options". Under the "Virtual memory" header, click the "Change" button.

    In the virtual memory dialog box, highlight each of your listed drive letters, click the "No paging file" radio button, and click the "Set" button. After all listed drives have been set for no paging file, OK your way back out. Windows will advise a reboot before the settings take effect. OK and reboot.

    Next, defrag the drive where you want your paging file. Having no pagefile will not be a handicap for this procedure. When the defrag is finished, go back through the above steps, except now highlight the drive of choice, click the "Custom size" radio button. In the "Initial size (MB)" and "Maximum size (MB)" fields, use the same value. I suggest 4096 (4GB). OK your way back out, and again Windows will advise a reboot. OK and reboot.

    Having defragged your drive of choice, and making the pagefile 4GB, it will be written as a single contiguous file on the drive. Having set the custom initial size and maximum size to be the same, Windows will never try to resize the pagefile, and it will stay in its contiguous state henceforth.

    This is the procedure I used back when I still used a pagefile, and it worked very well indeed. The pagefile never fragmented.
    Last edited by bbearren; 2013-02-12 at 12:13.
    Create a fresh drive image before making system changes, in case you need to start over!

    "The problem is not the problem. The problem is your attitude about the problem. Savvy?"—Captain Jack Sparrow "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware.
    Unleash Windows

  5. The Following 4 Users Say Thank You to bbearren For This Useful Post:

    CLiNT (2013-02-12),curiousclive (2013-02-12),Jagworld (2013-11-28),KritzX (2014-07-25)

  6. #5
    Silver Lounger
    Join Date
    Oct 2012
    Posts
    2,335
    Thanks
    13
    Thanked 267 Times in 260 Posts
    Ya that's exactly what I do if one ever does come up as fragmented. It seemed to be more of a problem back in the days of limited drive or partition size though honestly I haven't even checked Win 7 in a long time as I just let the scheduled defrag do it's thing.

  7. #6
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Thanks for all comments!
    • Sadly, Mark Russinovich's PageDefrag utility pagedfrg.exe hasn't been updated for Windows 7, and the interior of the pane is blank. (Sometimes it complains that you aren't running as an Administrator, even though one is!)
    • Piriform Defraggler will show pagefile.sys in the File List tab when you click on Analyze, if it has more than one extent, but can't do anything about it. No doubt MyDefrag gives similar results, but I haven't used it since it was JKDefrag.
    • I've often done the "remove page file -> reboot -> defrag -> add page file -> reboot" procedure in XP before I discovered PageDefrag.

    These are work PCs running Windows 7 Pro with only (only?!) 2 GB of memory, and I was hoping to be able to run a utility via PSEXEC on all of them to get the information back to my admin PC.
    BATcher

    Time prevents everything happening all at once...

  8. #7
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,575
    Thanks
    5
    Thanked 1,057 Times in 926 Posts
    Depending on the workload and free space on the drives, you could consider just using the Windows 7 defrag and not worrying about the pagefile. I do not install a third party defrag program on any Windows 7 or Windows 8 box.

    Joe

  9. #8
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    3,760
    Thanks
    26
    Thanked 424 Times in 338 Posts
    Quote Originally Posted by BATcher View Post
    No doubt MyDefrag gives similar results, but I haven't used it since it was JKDefrag.

    MyDefrag will defrag the pagefile if booted from CD or USB. But the method I outlined in post #4 (creating a custom, fixed-size pagefile) is a permanent solution; the pagefile will never again fragment.
    Last edited by bbearren; 2013-02-12 at 15:46. Reason: clarity
    Create a fresh drive image before making system changes, in case you need to start over!

    "The problem is not the problem. The problem is your attitude about the problem. Savvy?"—Captain Jack Sparrow "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware.
    Unleash Windows

  10. #9
    Bronze Lounger
    Join Date
    Jan 2010
    Location
    Birkirkara, Malta
    Posts
    1,467
    Thanks
    205
    Thanked 15 Times in 14 Posts
    bbearren, regarding your post #4, I used your method in Win 7 and had no problems. However, in Win 8, in the virtual memory dialogue box, the "No paging file" radio button was greyed out. Is there another way to deal with this in Win 8?
    OS Dual Boot Windows 10 Pro 64 Bit & Windows 7 Pro With SP1 64 bit. (Intel Core i7 2600K Processor LGA1155-Asus P867 Pro Motherboard-GTX550 Ti DirectCU Graphics Card-Memory 8GB)

    Roy Whitethread

  11. #10
    Super Moderator bbearren's Avatar
    Join Date
    Dec 2009
    Location
    Polk County, Florida
    Posts
    3,760
    Thanks
    26
    Thanked 424 Times in 338 Posts
    Quote Originally Posted by royw View Post
    bbearren, regarding your post #4, I used your method in Win 7 and had no problems. However, in Win 8, in the virtual memory dialogue box, the "No paging file" radio button was greyed out. Is there another way to deal with this in Win 8?
    Did you un-tick the checkbox by "Automatically manage paging file size for all drives" at the top of the Virtual Memory property sheet? I've used the same procedure in Windows 8 to eliminate the paging file on my laptop and my desktop.
    Create a fresh drive image before making system changes, in case you need to start over!

    "The problem is not the problem. The problem is your attitude about the problem. Savvy?"—Captain Jack Sparrow "When you're troubleshooting, start with the simple and proceed to the complex."—M.O. Johns "Experience is what you get when you're looking for something else."—Sir Thomas Robert Deware.
    Unleash Windows

  12. The Following User Says Thank You to bbearren For This Useful Post:

    royw (2013-02-14)

  13. #11
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Quote Originally Posted by JoeP517 View Post
    Depending on the workload and free space on the drives, you could consider just using the Windows 7 defrag and not worrying about the pagefile. I do not install a third party defrag program on any Windows 7 or Windows 8 box.
    Joe, I didn't bother installing Defraggler on all the PCs, I just remote control them with an Administrator account and run
    "\\MyAdminPC\C$\Program Files\Defraggler\Defraggler.exe"

    In the Defraggler "File list" tab, after running Analyze, I found pagefile.sys in two fragments on eight PCs, and so went through the
    "remove page file and system volume information files -> reboot -> defrag -> add page file with min size same as max size, and set up system restore again -> reboot"
    When I got into the swing of it, it only took a few hours!
    BATcher

    Time prevents everything happening all at once...

  14. #12
    New Lounger
    Join Date
    Nov 2013
    Location
    Chicago, IL USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The suggestion in #4 did not work for me. Having defragged my drive, there are still files cluttering the free space and when I remake the pagefile, it is fragmented in 8 pieces. How the heck do I absolutely clear the free space as one contiguous space?

  15. #13
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,575
    Thanks
    5
    Thanked 1,057 Times in 926 Posts
    Quote Originally Posted by Edwardj51 View Post
    The suggestion in #4 did not work for me. Having defragged my drive, there are still files cluttering the free space and when I remake the pagefile, it is fragmented in 8 pieces. How the heck do I absolutely clear the free space as one contiguous space?
    If the files are marked unmovable there is no way to move them.

    Joe

  16. #14
    New Lounger
    Join Date
    Nov 2013
    Location
    Chicago, IL USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by JoeP517 View Post
    If the files are marked unmovable there is no way to move them.

    Joe
    Files are not unmovable. My drive has 52% free space and the files cluttering the free space are not fragmented and are regular files that could be moved. Is there an OPEN SOURCE product that will clear the free space as one contiguous space?

  17. #15
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    A defragmenter won't move files that are open or in use, or even some system files. Those are then said to be unmovable. Some defragmenters can boot into their own pre-OS environment to take care of such files.
    Rui
    -------
    R4

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •