Sysinternals Homepage
Forum Home Forum Home > Windows Discussions > Internals
  New Posts New Posts RSS Feed - Size and contents of PAGEFILE.SYS
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Size and contents of PAGEFILE.SYS

 Post Reply Post Reply Page  12>
Author
Message
spool View Drop Down
Newbie
Newbie
Avatar

Joined: 05 June 2005
Location: Spain
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote spool Quote  Post ReplyReply Direct Link To This Post Topic: Size and contents of PAGEFILE.SYS
    Posted: 05 June 2005 at 12:55pm

Hi all,
and sorry for my terrible english !!

I'd like to know what are the contents of PAGEFILE.SYS,
and why is so bigger?

For example, this PC with WinXP have 1 GB RAM, and has a PAGEFILE.SYS of 1,5 GB in rest, and a memory consumption (taskmgr.exe) of 197 MB.

I think this file contains memory pages don't accessed recently for  processes, so i supposed, that this file size will be the sum of the difference between virtual memory size and resident memory size of all the procesess running in the system (maybe a little simple thought, i know ).

Also, i remember a very different behaviour of this file in size, in the family Win9X/WinME (much more like i supposed), than in the family Win NT/2K/XP.

So, why this file is so bigger? It is filled with zeroes or similar? Has any internal fragmentation? Is page aligned (4KB)?

Any idea? ....

Thanks in advance,
Jorge

Back to Top
Maddog View Drop Down
Newbie
Newbie


Joined: 05 June 2005
Location: Israel
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maddog Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2005 at 10:29pm

Hi Jorge,

The pagefile.sys file is used by the virtual memory.
It should be about 1.5 times your RAM memory.

It is logical to assume that when you had on older OS like Win9x, you had less RAM, so you needed a relatively smaller paging file.

You can set the size of the paging file in:
(assuming you're on WinXP)
Start > Control Panel > System > Advanced Tab > Performance Settings > Advanced Tab > Virtual Memory settings.

Good Luck



Edited by Maddog
There's no place like 127.0.0.1
Back to Top
Martin Zugec View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: Czech republic
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Martin Zugec Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2005 at 1:07am

2Maddog: Well, I think settings like 1,5 times your RAM etc are hoaxes... Why shouldnt you leave memory management on system?

Found this "tweak" many times, but noone didnt describe to me why it should be better to use preset value.

But I have another question regarding pagefile - what is the TempPageFile (it is available in WMI class Win32_PageFileUsage)?

Back to Top
Guruman View Drop Down
Newbie
Newbie
Avatar

Joined: 06 June 2005
Location: Canada
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guruman Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2005 at 10:50am
I can vouch for the fact that Windows XP automatically creates a pagefile that is 1.5 times the physical RAM size - no tweaking or hoaxes at all.

Generally, there's little reason to alter what the OS sets up by default.

As for TempPageFile, according to MSDN:

TempPageFile
Data type: boolean
Access type: Read-only
Windows Server 2003 and Windows XP:  If true, a temporary page file has been created, usually because there is no permanent page file on the current computer system.
The use of a temporary page file seems to be something that's done as part of maintenance (i.e., creating a temporary page file on a secondary drive so that the primary drive can be defragmented).
Back to Top
Holger View Drop Down
Newbie
Newbie


Joined: 04 June 2005
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Holger Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2005 at 4:34pm

>For example, this PC with WinXP have 1 GB RAM, and has a PAGEFILE.SYS of 1,5 GB in rest, and a memory consumption (taskmgr.exe) of 197 MB

This means your apps use 197MB and 197MB is RESERVED on pagingspace for them. It might be possible that there is nothing on the pagingspace yet.

There is no recomendation about size; that depends too much on your system, on your applications. There is a rule of thumb (1x5 x real memory). Regarding todays harddisc-prices I see no point in finetuning it.

Regarding the "hoax" of setting a fixed size. AFAIR windows did dynamically size ps on older version. Of course resizing takes time - that why it sometimes helped to create a fixed-sized ps.

 

Back to Top
Cyrano0815 View Drop Down
Newbie
Newbie
Avatar

Joined: 08 June 2005
Location: Germany
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cyrano0815 Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2005 at 11:04am

there's some truth in parts of what has been written before

here's my 2 cents:

- the system allways trys to have as much physical RAM available as possible (as having to use paged out memory is slow)
-> so memory pages which haven't been accessed for long are moved to the PF

- the "rule of thumb" mentioned earlier (1.5*mem size=PF) is complete
nonsense (or as good as 4.7*pf or 23.3453*pf or whatever you like)
A "justifyable" size for the PF is ONLY a function of the applications you are using: (and if Kernel Debugging means anything to you)

let me make that clear with three (extreme) examples:

1) A notebook with 2GB of RAM and Notepad as the only application used -> This NB doesn't need a Pagefile at all -> PF size 0 MB

2) a computer running Office 2003, SAP, Oracle and 128 MB of physical RAM
-> This machine is going to use the swap file a lot (and will be painfully slow -> get more RAM)
-> The PF has to be quite big. a good approach would be to gradually increase it until you don't get "out of memory" errors anymore

3) If you know how to use a Kernel Debugger and you want to analyse a crashdump (to find the reason for a BSOD) it might be necessary to enable a "FULL MEMORY DUMP" in the Startup & Recovery Options. In case of a BSOD, this dump is first written to the pagefile. (it will be extracted from the PF during the next reboot -this is triggered by Winlogon.exe)
-> in this case, your pagefile HAS to be bigger at least 1MB bigger than the amount of physical memory in your system.
(there are some exeptions to this rule for machines with more than 2GB of RAM, but let's just ignore them here)

1.5*pf will for sure do, but might be a waste of HD space -:)

For performance reasons, it makes sense to set the PF to a fixed size.
(as constant pf resizing might degrade system performance and - in some scenarios- increase hd fragmentation)

-> Conclusion:

You most likely don't need a pf at all if you have a lot of RAM and no need for a Kernel Debugger. Some business Apps specifically require a PF <>0 MB (as they are programmed that way)
-> I have 2GB of RAM and a fixed PF size of 256 MB on my home machine, 1GB of RAM and 1.1GB  PF on my notebook (where I use WinDbg)

If you don't have the luxury of 2GB or more RAM, gradually increase the PF size in chunks of maybe 100MB and use your apps the way you allways do. Your optimal PF size is the one where you don't get "out of memory errors" anymore

Best regards

cyrano



Edited by Mark
Back to Top
Cyrano0815 View Drop Down
Newbie
Newbie
Avatar

Joined: 08 June 2005
Location: Germany
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cyrano0815 Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2005 at 3:15pm
hello Mark,

can you comment on my explanation above ?
does that sound about right to you ?

BTW:
it's really cool to have this forum !
Process Explorer is the BEST tool in the wolrd!
Back to Top
D1rtyJ00 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 June 2005
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote D1rtyJ00 Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2005 at 5:54pm
Hi Cyrano, I'm not Mark, but I seem to remember from one of his lectures he described a good way to determine what your pagefile size should be.  He said you should pretty much just monitor your Current Committ Charge (as displayed by ProcExp) usage while performing typical tasks to your PC (email, gaming, word processing, downloading pr0n, etc.) and set your pagefile size to that neighborhood.  If you're really cautious, maybe even set it to your Peak Commit Charge after some consistent usage with all your app's and that is a good indication of how much you utilize your pagefile.
 
You are absolutely correct about the 1.5xRAM thing, that is just wasteful.
Back to Top
volkerb View Drop Down
Newbie
Newbie


Joined: 11 June 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote volkerb Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2005 at 2:07pm
hi,
 
i also now do have a 2GB-system. i run WinXP Pro SP2. after a fresh install windows automatically set the paging file to 2GB (same as RAM). under HKLM/System/CurrentControlSet/Control/SessionManager/MemoryM anagement i already disabled the paging executive and enabled the large system cache.
 
the situation: after using some app for some time (say adobe reader or browser) and allocating some memory, doing something else and return to the original app after some time, THERE IS A LAG - CAUSED by HDD I/O  !! how come?? there is still about 1GB of physical RAM free !! i want windows to keep anything needed to run smoothly in RAM !!!
 
1. any tips on how further to stop windows using HDD memory instead of RAM?
2. i think about installing a ramdrive and putting the paging file on there. might this work? (-> boot process? at what stage is paging started?)
3. does the max. working set size of an app has anything to do with it? how could i set it?
4. what about the reg-keys: PagedPoolSize, PagedPoolQuota, NonPagedPoolSize, NonPagedPoolQuota
 
thanks for any tips.
Back to Top
Mastertech View Drop Down
Newbie
Newbie
Avatar

Joined: 20 August 2005
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mastertech Quote  Post ReplyReply Direct Link To This Post Posted: 28 June 2006 at 6:32am
Originally posted by volkerb volkerb wrote:

under HKLM/System/CurrentControlSet/Control/SessionManager/MemoryM anagement i already disabled the paging executive and enabled the large system cache.
Large System Cache is a Myth. - XP Myths

Originally posted by volkerb volkerb wrote:

the situation: after using some app for some time (say adobe reader or browser) and allocating some memory, doing something else and return to the original app after some time, THERE IS A LAG - CAUSED by HDD I/O  !! how come?? there is still about 1GB of physical RAM free !! i want windows to keep anything needed to run smoothly in RAM !!!
The lag is probably because you enabled the large system cache which is only to be used on File Servers.

Originally posted by volkerb volkerb wrote:

1. any tips on how further to stop windows using HDD memory instead of RAM?
Buy more RAM. Which will reduce but not eliminate pagefile usage.

Originally posted by volkerb volkerb wrote:

2. i think about installing a ramdrive and putting the paging file on there. might this work? (-> boot process? at what stage is paging started?)
This is another Myth. - XP Myths
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down