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

    Home » Forums » AskWoody support » Windows » Windows 7 » Questions: Windows 7 » Windows 7: how to determine if the page file is fragmented

    Author
    Topic
    #487735

    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

    Plethora means a lot to me.

    Viewing 8 reply threads
    Author
    Replies
    • #1374388

      I used this in days when I was running Vista & XP. Never tried it on Win7 33116-PageDefrag

    • #1374430

      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).

      Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
      We all have our own reasons for doing the things that we do with our systems; we don't need anyone's approval, and we don't all have to do the same things.
      We were all once "Average Users".

    • #1374435

      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.

      Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
      We all have our own reasons for doing the things that we do with our systems; we don't need anyone's approval, and we don't all have to do the same things.
      We were all once "Average Users".

    • #1374442

      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.

    • #1374463

      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

      Plethora means a lot to me.

      • #1374470

        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.[/SIZE]

        Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
        We all have our own reasons for doing the things that we do with our systems; we don't need anyone's approval, and we don't all have to do the same things.
        We were all once "Average Users".

    • #1374469

      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

      --Joe

      • #1374663

        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
        “\MyAdminPCC$Program FilesDefragglerDefraggler.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

        Plethora means a lot to me.

        • #1425234

          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?

          • #1425235

            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

            --Joe

            • #1425306

              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?

    • #1374577

      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?

      • #1374586

        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.

        Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
        We all have our own reasons for doing the things that we do with our systems; we don't need anyone's approval, and we don't all have to do the same things.
        We were all once "Average Users".

    • #1425309

      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.

    • #1425407

      The files are movable, and closed. Nothing else was running when I used Defraggler to try to give me contiguous free space, but it did not work.

      • #1425431

        The files are movable, and closed. Nothing else was running when I used Defraggler to try to give me contiguous free space, but it did not work.

        If you ran the program from within Windows, there are always files in use. That’s why some programs do some types on defragging immediately after boot (I use PerfectDisk and it does this).
        I don’t know Defraggler, but from my personal experience, getting contiguous free space may be harder to get. On defragmenters that allow multiple defragmenting modes, some modes may be more effective than others, on this specific free space defragmenting.

    Viewing 8 reply threads
    Reply To: Windows 7: how to determine if the page file is fragmented

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: