PDA

View Full Version : Can a pagefile be too big?


poopboypat
07-15-07, 11:44 PM
Hi all i was wondering if making the pagefile size really big will have bad effects on the system? Currently i have 1 GB of ram and I have had the page file at 3072MB. So its about 3x's my ram size. Im running vista so I allso have 500MB of ReadyBoost as well. I was just wondering if this hurts my computer?

I use this computer for games like Oblivion.

thideras
07-15-07, 11:46 PM
Hi all i was wondering if making the pagefile size really big will have bad effects on the system? Currently i have 1 GB of ram and I have had the page file at 3072MB. So its about 3x's me ram size. Im running vistaso I allso have 500MB of ReadyBoost as well. I was just wondering if this hurts my computer?

I use this computer for games like Oblivion.I see no reason that it would hurt the system except for taking up that much disk space. If you were to set it to the entire HDD, you'd have no space left :-/

freakdiablo
07-16-07, 05:38 AM
Well, alot of people including myself say that 1.5x your system ram should be fine, but like thideras said, the only downside is a decrease in storage space.

jason4207
07-16-07, 02:14 PM
What is the logic behind the 1.5x (or any multiplier) for the pagefile size? It seems to me that the more RAM you have the less pagefile space you need. Of course you don't want to eliminate the pagefile.

I read a pretty good XP tweak guide a few years ago, and it stated that you should figure the maximum amount of memory you might ever need (2GB was suggested), go up about 512MB, and then subtract the amount of RAM you have installed. This was back in DDR1 days when 1GB RAM was usually the norm. I figured I might need 2GB, so I added 512MB, and subtracted the 1GB RAM installed for a total of 1.5GB pagefile size. If you have a system w/ 2GB+ RAM then you can run the pagefile fairly small, but never eliminating it. I think the minimum suggested was either 20 or 200MB...can't remember but, 200 sounds more realistic.

Now in the DDR2 days I can see the max being around 4GB, so will add 1GB (adjusting for current specs), and subtract 2GB (typical) installed RAM for a total of 3GB pagefile size. This just so happens to be 1.5x the RAM, but if you have 4GB RAM it works out differently. The logic being that you don't need a 6GB pagefile.

Comments?

Thund3rball
07-16-07, 02:40 PM
What is the logic behind the 1.5x (or any multiplier) for the pagefile size? It seems to me that the more RAM you have the less pagefile space you need. Of course you don't want to eliminate the pagefile.

I read a pretty good XP tweak guide a few years ago, and it stated that you should figure the maximum amount of memory you might ever need (2GB was suggested), go up about 512MB, and then subtract the amount of RAM you have installed. This was back in DDR1 days when 1GB RAM was usually the norm. I figured I might need 2GB, so I added 512MB, and subtracted the 1GB RAM installed for a total of 1.5GB pagefile size. If you have a system w/ 2GB+ RAM then you can run the pagefile fairly small, but never eliminating it. I think the minimum suggested was either 20 or 200MB...can't remember but, 200 sounds more realistic.

Now in the DDR2 days I can see the max being around 4GB, so will add 1GB (adjusting for current specs), and subtract 2GB (typical) installed RAM for a total of 3GB pagefile size. This just so happens to be 1.5x the RAM, but if you have 4GB RAM it works out differently. The logic being that you don't need a 6GB pagefile.

Comments?

I have heard this before to, and it is probably true. I don't think I have ever seen my pagefile get over 249MB. However with everyone having 200 GB - 1 TB storage nowadays, I don't think sticking with the 1.5x RAM formula is such a bad thing. Does your system ever use that much, doubt it. But storage is cheap and plentiful IMO.

DeadSmiley
07-16-07, 02:57 PM
I set mine to 1.5 times whatever my RAM size is on both the minimum and the maximum. That way the page file does not dynamically grow and shrink.

I have never had problems with this as far as I know. <shrug>

bing
07-16-07, 03:02 PM
I think you should worry more about Page File's fragmentation, especially your rig does paging heavily.

jason4207
07-16-07, 03:18 PM
I set mine to 1.5 times whatever my RAM size is on both the minimum and the maximum. That way the page file does not dynamically grow and shrink.

I have never had problems with this as far as I know. <shrug>


I definitely agree that you should set the min and max the same, but don't understand the logic behind the 1.5x thing is all. If you have 8GB RAM why do you need 12GB of pagefile?

Then again I can't see it negatively affecting performance...just wasting HDD space. Storage is cheap and plentiful as stated above, but I like to tweak everything, and wasting storage space just doesn't fit my personality.





I think you should worry more about Page File's fragmentation, especially your rig does paging heavily.


Agreed. :beer:

Thund3rball
07-16-07, 03:52 PM
I think you should worry more about Page File's fragmentation, especially your rig does paging heavily.

Ya I agree too. Actually learned a tweak that worked to defrag the pagefile for me. Although I am sure you can buy/find a defrag app that actually defrags your pagefile.

1. Set Pagefile to Zero (min & max) or No Pagefile
2. Reboot into SAFE MODE
3. Defrag
4. Set Pagefile to 1.5 x RAM (min & max)
5. Reboot to normal

thideras
07-16-07, 04:46 PM
Ya I agree too. Actually learned a tweak that worked to defrag the pagefile for me. Although I am sure you can buy/find a defrag app that actually defrags your pagefile.

1. Set Pagefile to Zero (min & max) or No Pagefile
2. Reboot into SAFE MODE
3. Defrag
4. Set Pagefile to 1.5 x RAM (min & max)
5. Reboot to normalWhy would this matter (I'm asking because I honestly don't know)? It isn't like it stores files in the pagefiling all the time...everytime it restarts it recreates it (I believe), so it would write over anything that would be there, I don't understand why you would need to defrag it...

shadin
07-16-07, 05:01 PM
Definitely set the min/max to be the same, and it's good to have a pagefile on a different hard drive than your OS, but still maintain one on the OS partition as well. Windows will use the one located on the least used partition first, but maintains DLL caches on it's home partition.

1.5x RAM is still a good idea, as well, as some programs (especially in the Adobe family) love requesting massive amounts of memory that isn't necessarily going to be used, which Windows allocates out of the pagefile initially.

Thund3rball
07-16-07, 05:23 PM
Why would this matter (I'm asking because I honestly don't know)? It isn't like it stores files in the pagefiling all the time...everytime it restarts it recreates it (I believe), so it would write over anything that would be there, I don't understand why you would need to defrag it...

I don't believe you are defragging the data that is stored in the page file, you are defragging the actual physical space it occupies and compressing it into one contiguous block. If you leave your pagefile at the "managed by Windows" default, the file will be resized constantly as Windows sees fit, causing it to become fragmented. Since you are probably adding and deleting data on a regular basis the page file cannot always occupy the same area on the disc when always being resized.

You cannot defrag the pagefile as you would your drives data. XP will not allow it. You need either a 3rd party tool like Diskeeper or a method like I mentioned.

bing
07-16-07, 05:30 PM
1st, you need to understand what is PF for ? :)

Layman term, it is part of your main memory for the OS, and yes, it is hell a lot slower than your real memory.

Here how it works, once you run out of real memory, the OS will start to swap out "rarely" used part of the memory into the PF to free up some real memory. Ok, again have to admit its oversimplified, actually its more complex than that, but I think this is enough to give you some clue.

Mark the word "run out of real/main memory", for today rig with 1 or 2 Gig of ram and running average application, this is no biggie.

Here simple/easy example, imagine you're running a photo editing "simultanously" on 20 huge images with each about 200MB, then you will see your rig crawling like hell since it running out of real memory and the OS will start using the PF as part of the memory, that process is called memory swapping or paging.

Your drive will work like hell when that happened, that is one of the reason the idea to put the PF on separate drive or fastest drive rather than main OS/program drive will help the overall performance.

Now about the page file fragmentation, in Windows OS, that PF file is sort of unique and exclusively locked by the OS. Try delete your pagefile.sys, you simply can't in normal mode, and it is just laid there from the 1st time it was created or modified, so its not created "everytime" you boot the rig.

Thund3rball si right, only 3rd party defragger can defrag it or special OS mode like mentioned above.

That is why if that PF is heavily fragmented "AND" the rig does paging "heavily", it will surely impact the performance since the HD head needs to hop around to access it instead of single fragment contigous page file.

Regarding the size, for common usage, 1 to 1.5 times of memory is ok for "average" usage.

Since you understand what PF really is, now I bet you will say "Actually, It Really Depends !" or you could easily answer the OP question now. :D

Regarding setting the min equal to max, we just force the OS not to wildly extend it's size cause once your hard disk doesn't have single contigous space large enough for it, the OS will start to scatter that PF files around which is bad. But again, its not that simple, even you're not running out of main memory, Windows sometimes will just extend it, why ?, only Microsoft could answer that. :)

Hope this "oversimplied" explanation helps.

Thund3rball
07-16-07, 05:37 PM
Thanks Bing you said it much better than I could :thup:

Just remembered this little FREE appy to defrag your pagefile. Though I cannot verify if it actually works. But it is an official MS TechNet Mark Russinovich release?

http://www.microsoft.com/technet/sysinternals/utilities/PageDefrag.mspx

thideras
07-16-07, 06:28 PM
1st, you need to understand what is PF for ? :)

*snip*

Since you understand what PF really is, now I bet you will say "Actually, It Really Depends !" or you could easily answer the OP question now. :DI know what PF is....:beer:

I understand what you saying, but wouldn't just deleting it, restarting and recreating it do the same thing? W/e, doesn't matter though :beer:

Thund3rball
07-16-07, 06:41 PM
I know what PF is....:beer:

I understand what you saying, but wouldn't just deleting it, restarting and recreating it do the same thing?

No I don't think so... You need to defrag your HDD after deleting the page file to optimize the disc as much as possible and ensure you get one contiguous page file when you recreate it again. Otherwise you may just get another fragmented page file.

thideras
07-16-07, 06:53 PM
No I don't think so... You need to defrag your HDD after deleting the page file to optimize the disc as much as possible and ensure you get one contiguous page file when you recreate it again. Otherwise you may just get another fragmented page file.Wait, I just got it!! :bday: Lol, I forget there are OTHER files on the drive that DONT move!!! YOU WIN!:santa::santa:


/offtopic (kinda)

Metalone
07-17-07, 01:44 PM
I am not an expert, but I did find a tip in a Windows XP tips site that may help with the pagefile discussion. From what I read, you have the option to set the pagefile to purge at shutdown within the registry and this should make the defrag option a mute point - I believe. The site address is http://reviews.cnet.com/4520-10165_7-5554402-1.html

Go to the registry key below and set ClearPageFileAtShutdown to 1.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Memory Management

Sean

place
07-17-07, 06:35 PM
why does the pagfile get used even if you have plenty of memory? mine always stays at about 235mb used when im not doing anyting and i have over 2gb of memory

shadin
07-17-07, 06:47 PM
There's a few reasons for that, I'll touch on two:

First, Windows will ALWAYS page parts of the operating system (DLLs, etc) that you MIGHT need but that you wouldn't want kept in your RAM "just in case".

Second, some applications will request a "buffer" of memory from Windows, coming from the pagefile, for predicted usage, not actual usage. Windows would rather give those programs virtual memory from the pagefile rather than tie up actual RAM that may or may not be needed.

Shakir_Akbari
07-20-07, 08:15 PM
not to beat a dead horse, but there is a tip i'd like to share with ya'll

if you create a separate partition on your drive, and stick the PF over there (set c: to 0 mb, and partition to #mb), it wont get fragmented, and you can forget about the 3rd party apps and whatnot.

also i've heard people say that the PF should be 3x the ram size. this has never made sense to me, and i'm glad to hear some other opposing views on that

place
07-21-07, 07:12 PM
if you create a separate partition on your drive, and stick the PF over there (set c: to 0 mb, and partition to #mb), it wont get fragmented, and you can forget about the 3rd party apps and whatnot.


how can you specify where the page file gets written to?

orion456
07-21-07, 10:54 PM
how can you specify where the page file gets written to?

my computer/properties/advanced/performance settings/advanced/virtual memory

You can pick your drive and the size of the page file. The best thing to do is set both the min and max to the same size, then windows automatically sets a contiguous region of hard drive space for the swap file. It also stops windows from contantly "managing" the space, making it bigger and smaller. 4096 mb is more than enough for most people.

If you have a gig or more of memory you should also set the the following flag in the registry to 1, so that windows keeps the its kernal in memory instead of swapping part out to disk.

Click on Start => Run => type regedit and enter
- Go to HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\ Session Manager\ Memory Management\ DisablePagingExecutive
- Set the value to be 1
- Reboot the computer

Shakir_Akbari
07-25-07, 11:58 AM
If you have a gig or more of memory you should also set the the following flag in the registry to 1, so that windows keeps all its files in memory instead of swapping them out to disk.


i dont think a gig will be sufficient if either of the following is true: you run vista or you use an integrated graphics card

i am currently getting really interested in optimizing my page file, i think that i am going to end up getting a compact flash -> SATA adapter (http://www.addonics.com/products/flash_memory_reader/adsahdcf.asp) and run my page file off that.

yes my pc might go though a CF card every 2 years but that is ok with me - seek times of .2ms make me happy. there are a few other tweaks to make XP lighter, see the FAQ here:

http://mason.gmu.edu/~sfiorito/eXPinstall.htm

this doc talks about using some of the features in XPe to make XP less memory hungry

BrutalDrew
07-27-07, 09:22 AM
f you create a separate partition on your drive, and stick the PF over there (set c: to 0 mb, and partition to #mb), it wont get fragmented, and you can forget about the 3rd party apps and whatnot.

All this would is is increase the average seeking distance, thus hurting performance in the end. For optimal performance the pagefile should be set to the most-used partition and on the last-used drive. If you only have one drive, leave it with applications an the OS, don't seperate it. There's also no point in setting a static size page file. Windows only resizes the pagefile if it needs to, so if the initial is set high enough, fragmentation won't be an issue. I'd definitely rather leave that "safety net" there and allow it to resize when it needs to. Also, with a dynamically sized pagefile, if more is needed, it is added somewhere else on the disk, and upon reboot will go back to its initial non-fragmented self. Thus, the pagefile does not get fragmented anyway.

I suggest just leaving the pagefile system managed (and no, a large pagefile won't hurt you), or if you really want to, monitor your PF usage using the "%usage" counter in perfmon and use that as to determine the optimal size for your pagefile. Just run your most intensive applications for a while and see how much of the PF is actually getting used. Then set the initial size to 4x that number. Then the max should be set to at least 2x the initial size. This insures the initial size is large enough to where it doesn't fragment, but still leaves that "safety net." So you get the best of both worlds.

Not that all this fragmentation talk really matters though. The only way a fragmented pagefile would really effect performance were if it fragmented files around it that are read in a sequential fashion. The pagefile itself is not read in such a fashion. In fact, Windows doesn't write more than 64K per buffer to the pagefile at a time anyway (pages are 4K, but Windows writes them out in "chunks" of 64K at a time). Also, very rarely are they even in 64K chunks. The majority of the time paging to the pagefile is inturputed by paging to many other files on disk. So even if the pagefile is one large contigious chunk, it doesn't even matter. The head is hopping all over the place anyway.