Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
June 19, 2013, 03:51:34 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Move pagefile to start of disk? (recreating pagefile doesn't do this)  (Read 6681 times)
DWalker59
JkDefrag Hero
*****
Posts: 62


View Profile
« on: June 17, 2009, 11:44:13 pm »

I know that my pagefiles are not fragmented; I know that "pagedefrag" from Sysinternals (now part of Microsoft) will defragment the pagefile into one piece (but not move it), and I know that setting the pagefile min and max size to the same value will keep it from getting defragmented in the future.  However, it still may be far away from the rest of the data on a disk.

I also have seen that setting the pagefile size to zero, rebooting, setting a new size, and rebooting again results in the page file smack in the middle of a disk (Windows XP SP2 and SP3).

I searched these forums for this answer, but the only thing I saw was to delete the pagefile and recreate it.  It ends up in the middle of the disk.

SO, I'll ask again... If we run MyDefrag from UBCD4Win, or BartPE, and tell it to put "pagefile.sys" near the start of the disk, will it work?  (I plan to try this as soon as I get some time, unless you say it won't work.)

I often help fix friends' computers, and I usually convince them to buy more memory, but I still want the pagefile to not be all by itself in the middle of a disk!  It gets lonely there.

Thanks.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #1 on: June 18, 2009, 12:12:35 am »

If we run MyDefrag from UBCD4Win, or BartPE, and tell it to put "pagefile.sys" near the start of the disk, will it work?
Yes.
Logged
gemisigo
JkDefrag Hero
*****
Posts: 110


View Profile
« Reply #2 on: June 18, 2009, 12:13:12 am »

I also have seen that setting the pagefile size to zero, rebooting, setting a new size, and rebooting again results in the page file smack in the middle of a disk (Windows XP SP2 and SP3).

That is interesting. According to my observations, after setting size to zero, rebooting, and setting a new fixed size, Windows will recreate the pagefile at the first gap big enough to put the file in if there is any. Otherwise it will break it into several pieces. Therefore you could try to create a script that vacates an area of appropriate size, remove the pagefile, run the script, and recreate pagefile. By the way, I observed this on Vista, for what it's worth. May not be true for XP (sp any).

On the other hand, I would not recommend bringing the pagefile to the start of the disk. There are many other files used frequently, and moving this file to the front would make those other files getting in worse position and accessing them slower. You should do things that favor the many rather than the few. Or what is better, find a balance somewhere between Smiley

EDIT: the best solution is to have the pagefile on a separate disk, first partition, start.
« Last Edit: June 18, 2009, 12:16:01 am by gemisigo » Logged
Huggu
JkDefrag Hero
*****
Posts: 58


View Profile
« Reply #3 on: June 18, 2009, 06:22:29 am »

you may considder one more option: run your windows WITHOUT swapfile. i suggest this solution in case you have 3GByte ram or more. I am running my windows xp for one year this way and no apllications complains Wink
Logged
gemisigo
JkDefrag Hero
*****
Posts: 110


View Profile
« Reply #4 on: June 18, 2009, 08:58:40 am »

Yepp, that's another option. I did that too, for about half a year with 4GB of ram and it worked flawlessly.

But now there are occasions that I'm running more than 3 virtual machines simultanously, each having 512M-1GB of ram and having a 6GB pagefile is almost essential Smiley
Logged
DWalker59
JkDefrag Hero
*****
Posts: 62


View Profile
« Reply #5 on: June 22, 2009, 05:27:36 am »


That is interesting. According to my observations, after setting size to zero, rebooting, and setting a new fixed size, Windows will recreate the pagefile at the first gap big enough to put the file in if there is any. Otherwise it will break it into several pieces. Therefore you could try to create a script that vacates an area of appropriate size, remove the pagefile, run the script, and recreate pagefile. By the way, I observed this on Vista, for what it's worth. May not be true for XP (sp any).

EDIT: the best solution is to have the pagefile on a separate disk, first partition, start.



On my own computers (all four of them) I always have the pagefile on its own physical disk.  But, I often work on other peoples' computers, and often they have one physical disk.  That's the case where I want the pagefile to be near the other frequently used files, especially if they don't want to buy more RAM.  *MY* computers have 3 or 4 GB of RAM, but I often upgrade a customer's computer from 512 MB to 1 GB of RAM, and there's still some paging going on.

The page file could go after the other frequently used files, instead of before, but still, with XP, I see that it gets put in the middle of the disk, which might be a long way from the frequently-used files.
Logged
gemisigo
JkDefrag Hero
*****
Posts: 110


View Profile
« Reply #6 on: June 22, 2009, 09:12:44 am »

The page file could go after the other frequently used files, instead of before, but still, with XP, I see that it gets put in the middle of the disk, which might be a long way from the frequently-used files.
Well, that leaves you with your own idea as your only option. Boot into a PE and order MyDefrag where to move that file. There is one question though. How can you determine which files are frequently used?
Logged
DWalker59
JkDefrag Hero
*****
Posts: 62


View Profile
« Reply #7 on: June 29, 2009, 06:58:40 am »

If all of the files (frequently-used and rarely-used) are in the first 10% of the disk, and then there's a big gap, and then there's the pagefile, then obviously the pagefile is some distance away from the frequently-used files.

If I boot with UBCD4Win on a CD, I can still defrag using the last-accessed date, right?  That's how I would determine which files are frequently (or recently) used.  The problem is the big gap between all of the files, and the pagefile, in the case where the disk is something like 500 GB with 15 GB in use, and the pagefile goes from about the 249th GB to the 251st GB.
« Last Edit: June 29, 2009, 07:07:27 am by DWalker59 » Logged
gemisigo
JkDefrag Hero
*****
Posts: 110


View Profile
« Reply #8 on: June 29, 2009, 07:59:34 am »

If I boot with UBCD4Win on a CD, I can still defrag using the last-accessed date, right?
You can, but those will be the last accessed files, not the most frequently used ones. You should not confuse these two things.
Logged
DWalker59
JkDefrag Hero
*****
Posts: 62


View Profile
« Reply #9 on: July 01, 2009, 03:52:28 am »

When I said "frequently used" I meant "recently used".  I know that there isn't a counter that keeps track of "most frequently used files".  The metadata includes file creation date, file modification date, and file last accessed date (if this feature hasn't been turned off in the registry).  (Files used "frequently" are very likely to have also been used "recently".)  :-)

Most other popular defragmenters like to sort by file creation date; this is dumb, since a file that was created a long time ago might be used all the time.

Anyway, my point stands:  A friend has one 500 GB disk in his computer, and there's 15 GB used plus a page file.  If the recently-used files and the rarely-used files are all within the first 15GB of a 500 GB disk, and then there's ~230 GB of free space, and then the page file, I would say that's not a very optimal layout (if there is any paging).  I would at least like the page file near the other 15 GB that's on the disk, not way out in the center -- regardless of how much RAM he has.  Even if the pagefile is after the other 15GB instead of before the other 15 GB, it should be close.

Yes, I know that if I were to put the 2 or 3 GB page file before the other data it would move the other data out a little bit, to a fractionally slower part of the disk, but not much.
Logged
gemisigo
JkDefrag Hero
*****
Posts: 110


View Profile
« Reply #10 on: July 01, 2009, 08:15:16 am »

Most other popular defragmenters like to sort by file creation date; this is dumb, since a file that was created a long time ago might be used all the time.
It is not. If I recall correctly, even JkDefrag has a switch to do that sort of sorting Smiley Imagine that you want to speed up the os. On a system partition those files "should" be created first (now we do not care that some drivers have ancient creation dates Smiley ). Sorting them by creation date moves os files to the front. Of course, this theology fails after we acquire the knowledge that most of these files are just "padding" for the more important ones so that they do not get damaged when you move them around and they hit the walls of your disk Cheesy
So, the lesson is it is dumb indeed, but it is not its fault Wink
Logged
Maniaque27
Newbie
*
Posts: 2


View Profile
« Reply #11 on: September 25, 2009, 11:09:57 am »

Hi,

I imagine this thread is the source of the FAQ item on the page file...

I run windows XP SP3 with 3GB RAM (4, but windows 32-bit only ever sees 3...), and to get my pagefile to behave I told windows to stop usng the pagefile, rebooted, did a full defrag, and only afterwards reenabled the pagefile.

Now after the full defrag my "free space" was still slightly fragmented from nmovable files (drivercache mostly I think), but I would expect windows to do something like the "wraparound" feature that MyDefrag uses - when allocating a new file, I would assume windows will simply use the first available spaces on the disk, as sequentiually as possible... Instead, it created a "distributed" file allocation for my new pagefile, I don't get it at all!

I'll try to attach the illustration from MyDefrag analysis - the red mess at the top is the new 2GB pagefile.

I will try the sysinternals/microsoft tool referenced above now to see if that helps, but does anyone have any idea why windows did what it did here??

Thanks,
Tao


* Newly Created Pagefile already super-fragmented.png (24.19 KB, 887x685 - viewed 1351 times.)
Logged
antikythera
JkDefrag Senior
****
Posts: 46



View Profile WWW
« Reply #12 on: September 25, 2009, 01:20:33 pm »

yes windows would do this because there wasn't enough free contiguous space to create the pagefile due to the other unmoveable files in the area that red mess has been created in. Can't say I have ever seen such extreme fragmentation of the pagefile though. Shocked

because mydefrag works fine in safe mode, it may be possible disable the pagefile and delete it, then to move at least some of those previously unmoveable files and sort the issue out.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #13 on: September 26, 2009, 09:51:42 am »

I would expect windows to do something like the "wraparound" feature that MyDefrag uses - when allocating a new file, I would assume windows will simply use the first available spaces on the disk, as sequentiually as possible...
I don't know how exactly Windows allocates the pagefile, but I would expect it to use the largest gaps available. Not the first gap and then upward from there.
Logged
slender
JkDefrag Hero
*****
Posts: 51


View Profile
« Reply #14 on: September 26, 2009, 12:40:13 pm »

Just thinking aloud.
For this kind of special cases would it be good to add pagefile fragment level check feature to mydefrag. For example if pagefile fragments > xx  then info/warning message to user about situation.
« Last Edit: September 26, 2009, 02:52:31 pm by slender » Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!