can somebody explain pagefile to me?

HRslammR

2[H]4U
Joined
Jun 20, 2003
Messages
3,438
for whatever reason, while playing WoW:BC, my page file will jump up to 2gigs usage, and my system becomes near unusable. i have 2gigs of pc3200 memory (which for whatever reason is only running at pc2700...) so i shouldn't be having memory problems! what the heck could be the deal?
 
my page file was set to 1.5g, naturally after i looked at it i set it to 2g. now i have more than enough (70+gigs) of space available. and i'm running xp
 
Your pagefile is a section of your hard drive space that Windows will use as "Virtual Memory". When your application needs more RAM than you have, that data will go to the pagefile. You have the option to let Windows increase or decrease the size of your pagefile as it sees fit. Or you can set it to be static at a size YOU think is best.

A flamewar will quickly start as to what size is best to set it. Everybody has an opinion. Personally, a long time ago, I was told to set it static at 1 1/2 time the size of your installed RAM. Nowadays with 2 gigs of RAM common, this means I set mine at 3 gigs. Some people think this is ridiculous. But I have never had a problem....EXCEPT.....

Everquest 2 had a bad pagefile problem some time ago. Occasionally, the game would either lock up, or simply not load. The only solution was to delete your page file entirely, defrag, and reset you pagefile. AFAIK, your pagefile does not get defragged when you defrag your hard drive. This was a pain in the ass because you had to restart twice to do this. I only bring it up because you are also playing an MMORPG, so the problem may be similar. You can always blame it on the latest patch.

There was a time when I had my drives partitioned for gaming. I had the first partition on disk 1 dedicated to the game files and the first partition on disk 2 (5 gigs for a 3 gig pagefile) dedicated to the pagefile. (believing that the first partition being the outside of the platter had faster read times, but thats another story altogether.)
 
Does having your page file on the same drive/partition cause any problems. I posted a threat about this not long ago, only i'd rather keep the page file seperate from the OS. Do you think i should have the OS in 1 partition and the page file in the other, or will it better to have them together? I don't want everything getting fragmented, and i don't like defragged the OS drive. I would really appreciate your help, upriverpaddler.
 
I am NOT an expert on this, but here's my opinion. Probably more than 99% of all Windows installations have their pagefile and everything else on one partition. I really don't think it would ever be an issue. The only reason I put mine on its own partition on a separate drive was for the incredibly small (and theoretical) increase in read/write times. It does NOT make it easier to manage or affect how Windows uses it.

Even if you keep all of your data files separate from your Windows installation, you should still occasionally check that partition for fragmentation. Windows updates and program installation will affect those files.

Even if you make a separate partition for your pagefile, you still cannot defrag it (the pagefile itself, you can still defrag the drive but it wont affect the pagefile). At least not with the Windows defragger.


For example, here was my ideal setup:

Drive 1
Partition 1 E - Game files (Outside rings of platters. Theoretically faster reads)
Partition 2 F - Windows Installation
Partition 3 G - Data Files (Inside ring of platter. Theoretically slowest reads.)

Drive 2
Partition 1 H - Pagefile (Again outside rings)
Partition 2 I - Data files

Remember Theoretical and Small Increase before anyone flames.
 
Okay, thank you. I just don't know how to set up my 36GB and 150GB raptor when i get them. I want to use the 150GB for games and programs and the 36GB for the OS and page file. Do you think i should leave the 36GB un-partitioned? If not, i could create a small 4GB partition first (outside rings of platter) to have the page file, then have the OS stored on the rest.
 
If I was you, I would partition my drives like above. Have the raptor be drive 1 and the bigger drive be drive 2. Maybe leave out the 3rd partition on the raptor.

Remember that the performance gain would be theoretical, too small to measure, debatable, and possible draw sarcastic comments from other [H] members.
 
Okay, thank you. I just don't know how to set up my 36GB and 150GB raptor when i get them. I want to use the 150GB for games and programs and the 36GB for the OS and page file. Do you think i should leave the 36GB un-partitioned? If not, i could create a small 4GB partition first (outside rings of platter) to have the page file, then have the OS stored on the rest.

You've pretty much got the best arrangement laid out there. Partition the 36 GB so your paging file can't mess with fragmentation on your OS and to help you get better seek times when paging heavily.
 
You've pretty much got the best arrangement laid out there. Partition the 36 GB so your paging file can't mess with fragmentation on your OS and to help you get better seek times when paging heavily.

Yay, that's what i was hoping to hear! So the first partition on the 36GB can be for the page file, right? Then the rest can for the OS. How large do you recomment creating the page file partition, bearing in mind i will have 2 x 1GB RAM, and will eventually have 4GB? It used to be the case where the maximum page file size should be 3 x physical RAM, making it 12GB (to allow for the future RAM upgrade); however, that would just be silly. I just want to make sure that i have enough room left on the rest of the partition for vista and drivers.

Thank you for your help, everyone. :)
 
Yay, that's what i was hoping to hear! So the first partition on the 36GB can be for the page file, right? Then the rest can for the OS. How large do you recomment creating the page file partition, bearing in mind i will have 2 x 1GB RAM, and will eventually have 4GB? It used to be the case where the maximum page file size should be 3 x physical RAM, making it 12GB (to allow for the future RAM upgrade); however, that would just be silly. I just want to make sure that i have enough room left on the rest of the partition for vista and drivers.

Thank you for your help, everyone. :)

The "magic number" I've always heard was 1.5x the RAM count. So for 4 GB RAM you'd need a 6 GB paging file, and probably an 8 GB partition.

I'm trading for an 18 GB 15k rpm SCSI drive for the sole purpose of using it as a paging file drive. That's gonna be fun :)
 
The "magic number" I've always heard was 1.5x the RAM count. So for 4 GB RAM you'd need a 6 GB paging file, and probably an 8 GB partition.

I'm trading for an 18 GB 15k rpm SCSI drive for the sole purpose of using it as a paging file drive. That's gonna be fun :)

Right; also, do you think it's better to have a static page file with the min and max set at the same value?

I bet that SCSI drive will cost a bomb, but, i suppose, it will give you the extra performance.
 
Right; also, do you think it's better to have a static page file with the min and max set at the same value?

That will eliminate fragmentation of the pagefile. It's considered a good idea.

The only reason for putting the pagefile on a separate drive is to keep it off a slow writing drive - a RAID1 drive, for example. If you've got several drives of roughly equal performance, put a pagefile on each one. If you have a particularly slow drive in the mix, don't put a pagefile on that one. I used to say something different, but there was a good thread on the Drives forum and I've learned a few new things.

Way back when, those in the know were setting the pagefile to 2x RAM rather than 1.5. 1.5 is the minimum. YMMV and yes, you'll get a lot of opinions on this.
 
That will eliminate fragmentation of the pagefile. It's considered a good idea.

The only reason for putting the pagefile on a separate drive is to keep it off a slow writing drive - a RAID1 drive, for example. If you've got several drives of roughly equal performance, put a pagefile on each one. If you have a particularly slow drive in the mix, don't put a pagefile on that one. I used to say something different, but there was a good thread on the Drives forum and I've learned a few new things.

Way back when, those in the know were setting the pagefile to 2x RAM rather than 1.5. 1.5 is the minimum. YMMV and yes, you'll get a lot of opinions on this.

Thank you for the advice. Only now i've reading into it more, it seems that some people say that having the page file in a different partition on the OS drive will actually decrease performance, than if i were to leave it on the same partition as the OS.

Whatever happens, the page file has to be on the OS drive, since the other will be used for games (that way both can be read at the same time). I just don't know whether to have it in it's own 8GB partition or to just leave it as an unpartitioned drive. The main reason i wanted to have it in it's own partition is because it can be placed on the our rings of the drive (theoretically faster), then the OS will be on the second partition (this can be done, right?) But if i just leave the page file static and have its min and max values set the same, there will be no chance of fragmentation anyway.

Urgh... i thought i had all of this figured out.
 
I always ASSUMED that while a game is running, everything Windows needs to run is already in RAM and it will have no need to access the HDD. So having the OS and the game file on the same HDD would not affect performance.
 
I always ASSUMED that while a game is running, everything Windows needs to run is already in RAM and it will have no need to access the HDD. So having the OS and the game file on the same HDD would not affect performance.

Bad assumption. My system pages frequently, especially while loading new levels.

I'm hoping to be able to provide some numbers in the near future on some various things you can do with the paging file. I'll stay my speculation on just how much it affects performance until I know something more solid.
 
Bad assumption. My system pages frequently, especially while loading new levels.

I'm hoping to be able to provide some numbers in the near future on some various things you can do with the paging file. I'll stay my speculation on just how much it affects performance until I know something more solid.

I look forward to your findings. I really can't decide whether to put the page file in its own partition or not. I suppose it's not really a big deal, but the extra 1-2% performance increase, if that, is worth it, i think.
 
I look forward to your findings. I really can't decide whether to put the page file in its own partition or not. I suppose it's not really a big deal, but the extra 1-2% performance increase, if that, is worth it, i think.

It *should* reduce your fragmentation quite a bit, and that makes it worthwhile.
 
it seems that some people say that having the page file in a different partition on the OS drive will actually decrease performance, than if i were to leave it on the same partition as the OS.

If you only have one drive and the pagefile is in a separate partition, you might get an infinitesimal difference (slowing) due to the amount of head movement in the drive.

If you put the pagefile on a separate drive (say, your main drive is RAID1), then putting the pagefile in a separate partition and formatting the partition as FAT instead of NTFS will give a bit of advantage.

Whatever happens, the page file has to be on the OS drive, since the other will be used for games (that way both can be read at the same time).

If it's paging, they can't be read at the same time - the paging has to complete first.
 
Thanks again for your advice, everyone. :)
I think i'll just make a 10GB partition on the OS drive first, format it in FAT32, then the rest can be used for the OS. That way, it should reduce seek time since the page file is on the first partition.

If it's paging, they can't be read at the same time - the paging has to complete first.

So, paging can't be done on one drive at the same time as another drive is loading game textures, for example?
 
I have one more question, i think. People say not to put the page file in its own partition on the OS drive since it will cause thrashing due to movement between the OS partition and page file partition. However, when gaming how often will the head need to move over to the OS partition anyway? Most drive activity will be on the second 150GB raptor, won't it?
 
Drive 1
Partition 1 E - Game files (Outside rings of platters. Theoretically faster reads)
Partition 2 F - Windows Installation
Partition 3 G - Data Files (Inside ring of platter. Theoretically slowest reads.)

Drive 2
Partition 1 H - Pagefile (Again outside rings)
Partition 2 I - Data files

This partition scheme, right, upriverpaddler?
I would have a similar setup to this, only i won't have any 'data files' so Drive 2 would only have a page file on it. A bit of a waste, if you ask me- especially for a 36GB raptor.
 
Yes that one. You have your game files and pagefile on separate drives. Data files = My Music, My Pictures, My Documents. Use the Raptor as Drive one and the big drive for drive 2. I think all Windows files needed to run the OS will already be in memory when gaming.
 
Right. Paging takes priority and all other disk activity waits until it's done.

You sure about that? Got any info to back that up? Not having a go, just seems very unlikely. I'm pretty sure I can record some TV to my capping hard drive while my pagefile grinds away on my other drive because I've artificially used ram benchmarks to suck up all the ram. Infact, I know for a fact I can do that!

Here's my tuned setup:

HDD1 (RAID-0 array):

c: fat32 boot drive
d: Windows drive
e: Games drive
g: Large movies / vid capping drive

HDD2:

x: Page file drive
f: Backup and apps
o: Ghost of my windows d drive
 
You sure about that? Got any info to back that up? Not having a go, just seems very unlikely. I'm pretty sure I can record some TV to my capping hard drive while my pagefile grinds away on my other drive because I've artificially used ram benchmarks to suck up all the ram. Infact, I know for a fact I can do that!

I'm inclined to agree with you. I've not seen anything regarding Windows having to stop other disk access to page.

Now, what he might be saying is that the OS won't read data and page it simultaneously, but I also doubt that is the case. It certainly doesn't seem so with Vista.
 
A hard drive only has 1 read/write head. And it can only do one thing at a time. It is just going back and forth between the 2 so fast that it seems like it is happening at the same time.
 
A hard drive only has 1 read/write head. And it can only do one thing at a time. It is just going back and forth between the 2 so fast that it seems like it is happening at the same time.

That isn't simultaneous, though. Can a page file be read or written to at the same time as another drive is being read or written to?
 
There's lots of confusion surrounding page files. I hope I'm not too late to clear it up.

If you're looking at "Page File Usage" in the Windows XP Task Manager, you should know that this metric does not mean that the page file is actually being written to. It only means that space has been reserved in the page file, should a page fault need to occur.

The number is high because the game you're playing (and the other processes on your system) have allocated memory and put read/write content in them. If some other process comes along and demands memory, the OS wants to be able to swap what's in memory out to disk, clean up the memory, then offer it to the new requester. The place it gets swapped to is the page file. It's not swapped until demand requires it.

It's this reservation that's called "Page File Usage" in Windows XP. (You'll note that this UI has been significantly updated in Vista, and hopefully that causes less confusion.) What you actually care about are hard page faults; those are actually accesses to the disk. Problem is, you can't tell if they're access to the page file, or other locations on the disk that satisfy paging requests.

You can monitor hard page faults by using PerfMon:

1) Press The "Start" button
2) Select "Run"
3) type "Perfmon", hit enter
4) In the resulting PerfMon app, press the "+" button in the toolbar
5) Select "Memory" in the "Performance Object" dropdown
6) Select both "Page Reads/sec" and "Page Writes/sec" from the "Select Counters from list" control



7) Press "Add"
8) Press "Close"

The resulting graph will show hard page reads and hard page writes per second. Note that these counters include any hard page faults. Page reads count reads from executable images, and will spike any time a new program is run as pages are faulted in from the executable image. Both will count access to the page file, memory mapped files backed by user disk space, and a couple of other things. They're still not only accesses to the page file, in other words -- a few other things are mixed in.

On the other hand, any writes mean modified data is being shuffled off to disk. Modified data certainly isn't executable code, so these writes are likely to the page file -- but could also be to memory mapped files backed by user store. Applications sometimes use memory mapped files for their data files, and these can increase page file access activity. Hopefully, this practice is falling out of style because it is woefully inefficient.

When Windows writes to or reads from the page file, other I/O does indeed stop. I don't think paging access will stop an in-progress request, but the page access needs to be done because the process requesting the page can't continue executing until it is read back into memory. If the access was deferred, then the response of the waiting application would be extremely slow and the user's perception of the system would suffer greatly, even in situations where the system isn't really perceived to be busy.

The page file (and its location) may cause fragmentation, but this is easy to avoid: just make a fixed size for the paging file. When you do this, also run a defrag tool that does offline defragmentation and can guarantee that the page file contiguous. That's it.

The idea of putting the page file on a different physical drive is that the head of the other drives won't have to move to satisfy page requests. Assuming continuing sequential I/O, this is a win because the other drive can resume reading where it left off. Things don't always work out that way, but it does make the situation a little better.

I hope this helps. If you have any questions at all, please let me know and I'll be happy to help further.
 
A hard drive only has 1 read/write head. And it can only do one thing at a time. It is just going back and forth between the 2 so fast that it seems like it is happening at the same time.

Yes, and you double the number of read-write heads by using multiple drives, which is what we're talking about here.
 
Thank you very much, mikeblas, for taking the time to write that; it's helped a lot.

I do still have a couple of questions, though. I know i've hijacked this thread a little, well a lot actually, but I don't see any point in starting a new thread, so i'll just get it out now.

I am going to be building a gaming machine, only i don't know what kind of hard drive setup to use. All i'm going to have installed on there is the operating system (Windows Vista Home Premium [probably 64-bit]), games and possibly the addition of a few programs and applications; therefore i don't need a large hard drive for 'data storage'. With this in mind, what hard drives do you suggest i get, and what shall i have on which drives, with respect to the page file, OS and games? I am thinking of getting a 36GB raptor and a 150GB raptor; with the former split up into 2 partitions: the first for the page file and the second for the operating system; and the latter, 150GB drive, used for games and other programs. Do you think this get the most performance with this configuration, since i can't decide which drive to put the page file on, and whether it needs to be in its own partition or not; or, whether i should reconsider the whole plan completely and get different hard drives (3 x 7200RPM drives, for example).

Everyone here has been so helpful, and i am very greatful, it's just that i've read so many contradictions and everyone seems to have different opinions on the position of page files.
 
I'd run as many drives as you can afford.

Putting the page file on its own drive will help performance. It will be a very small boost; nearly zero, if you usually have enough memory for the applications you're running. I can't think of any rational argument showing that it would reduce performance.

Putting the applications you run on a separate drive will help in a similar way. Again, I don't see it hurting performance by any reasonable explanation. The benefit will be very small, particularly if you have plenty of memory.

Same for further splitting the applications and OS drive.

If you can afford to add the drives (and small drives are cheap, right?) then go ahead and do so. You'll notice a percent or less performance improvement, until you really load your system, make it thrash at the paging operations; then you'll see an increase in the several percent.

But what if you don't add these extra drives and just put everything on one drive? I don't think you're crippling yourself in any real way. If you're gaming, your disk access is manily starting the game and loading levels. The games I've investigated suck at doing file I/O during loads, and I don't think they're causing lots of hard page faults during the load (unless they're mistakenly using memory-mapped files for their loads; then, hope is lost).

Hence, my recommendation: if you've got the money for the extra drives, and want to spend it, go ahead and spend it. But don't expect a giant boost from it. In fact, don't expect much of a boost from it at all. You're certainly not hurting the performance of your computer, and it's up to only you if spending $80 or so on a couple of drives is worth a small improvement.

For me, I'm not sure it is. Say it takes 60 seconds to load the next level; I wouldn't spend $80 on being able to load the next level in 59.4 seconds. For you, maybe it is.
 
Thank you. I just need to draw the line somewhere; i mean, buying a 36GB raptor, for example, just for a page file and see <1% performance boost isn't really justifiable.

So with the setup i have planned, with a 36GB and 150GB raptor, where do you think the page file shall go. I want to put it in the first partition on the 36GB but people say that putting it on a different partition to the OS on the same drive as the OS causes thrashing, since the head is constantly moving between the 2. However, isn't this aimed at people who have games (or just programs in general) on their OS partition, and the head will be moving between the page file, on one partition, and programs, on the other partition? Because i can't see that, during a game, the head would need to move the the OS portion of the drive at all. So basically, what i'm asking is, is having the page file in first partition on the 36GB raptor and the OS on the remainder going to cause thrashing during games, since this will reduce performance; as opposed to having them in the same partition so the drive head doesn't move as much?
 
Putting the page file on its own drive will help performance.

Putting page files on several drives will likely be more advantageous. Windows will spread the load across the drives and select the least-used drive when required. If you've got three identical drives, no RAID, then put one-third of the pagefile on each one.

If you're running a big RAID1 drive pair, putting the pagefile on a separate drive may be faster than putting one on the RAID1 drives and one on a separate and will definitely be faster than putting only one on the RAID1 - that is due to the write speed penalty of RAID1.
 
Putting page files on several drives will likely be more advantageous. Windows will spread the load across the drives and select the least-used drive when required. If you've got three identical drives, no RAID, then put one-third of the pagefile on each one.
How do you figure this to be faster than putting the page file on a drive that has nothing else on it?
 
Good advice on this thread. The reality is that on a desktop config, at this stage, nothing you do with the pagefile is going to make an enormous difference one way or another. Windows has gotten quite good at dynamically managing it since Win2k, so I dont even bother setting it static. In the past, it has been advantageous to place a swap file on every physical drive (not partition, physical drive) for certain server configs, but to be honest, drives have gotten so fast, and on servers so much of the storage has been moved to SANs, that even these guidelines are not that important.

I personally wouldnt recommend partitioning a physical disk to put the swapfile on a dedicated partition. This would likely reduce performance by some miniscule amount as the head would need to seek into the new partition which would be more of a move than moving within the existing OS partition. But again, drives are fast, caches are big, RAM is huge, the OS is efficient, the load is low (except EQ2 - LOL), so you wont see big differences between just going with out of the box standard config vs painfully planning and architecting the optimal swap file layout.

The OS will always page even if you have a ton of physical RAM available unless you turn virtual memory off. The way memory is allocated is that the app flags it when it requests it as swappable if it can be swapped. Swappable RAM *will* get paged by the OS as just part of its normal housekeeping.
 
The OS will always page even if you have a ton of physical RAM available unless you turn virtual memory off. The way memory is allocated is that the app flags it when it requests it as swappable if it can be swapped. Swappable RAM *will* get paged by the OS as just part of its normal housekeeping.
I hear this one a lot. As stated here, it's not quite true. If the system is under low I/O load, it may write dirty pages to disk in anticipation of needing to swap them out later. This isn't exactly paging; it's saving time instead of wasting it.

The heuristic to decide when to put a page on the standby list has changed for Vista, and is one of the things I've pointed out in other threads as being a benefit to running the OS on more modern systems. The heuristics are designed with faster drives and larger memory in mind, as the typical Vista machine is more capable than the typical machine back at the release of XP.
 
ugh. anything i can do to fix my problem? my pagefile jumps to gigs and suddenly my system comes to a crawl. what is causing this!? :mad:
 
Back
Top