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.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Windows » Windows 7 » Questions: Windows 7 » Windows 7: how to determine if the page file is fragmented
I used this in days when I was running Vista & XP. Never tried it on Win7 33116-PageDefrag
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).
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.
Thanks for all comments!
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.
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]
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.
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
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?
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.
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.
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications