Windows page file use

Win32_PageFileUsage class

The Win32_PageFileUsage WMI class represents the file used for handling virtual memory file swapping on a Win32 system. Information contained within objects instantiated from this class specify the run-time state of the page file.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

Members

The Win32_PageFileUsage class has these types of members:

Properties

The Win32_PageFileUsage class has these properties.

AllocatedBaseSize

Data type: uint32

Access type: Read-only

Actual amount of disk space allocated for use with this page file. This value corresponds to the range established in Win32_PageFileSetting under the InitialSize and MaximumSize properties, set at system startup.

Caption

Data type: string

Access type: Read-only

A short textual description of the object.

CurrentUsage

Data type: uint32

Access type: Read-only

Amount of disk space currently used by the page file.

Description

Data type: string

Access type: Read-only

A textual description of the object.

InstallDate

Data type: datetime

Access type: Read-only

Indicates when the object was installed. Lack of a value does not indicate that the object is not installed.

Name

Data type: string

Access type: Read-only

Name of the page file.

PeakUsage

Data type: uint32

Access type: Read-only

Highest use page file.

Status

Data type: string

Access type: Read-only

String that indicates the current status of the object. Operational and non-operational status can be defined. Operational status can include «OK», «Degraded», and «Pred Fail». «Pred Fail» indicates that an element is functioning properly, but is predicting a failure (for example, a SMART-enabled hard disk drive).

Non-operational status can include «Error», «Starting», «Stopping», and «Service». «Service» can apply during disk mirror-resilvering, reloading a user permissions list, or other administrative work. Not all such work is online, but the managed element is neither «OK» nor in one of the other states.

Values include the following:

OK («OK»)

Error («Error»)

Degraded («Degraded»)

Unknown («Unknown»)

Pred Fail («Pred Fail»)

Starting («Starting»)

Stopping («Stopping»)

Service («Service»)

Stressed («Stressed»)

NonRecover («NonRecover»)

No Contact («No Contact»)

Lost Comm («Lost Comm»)

TempPageFile

Data type: boolean

Access type: Read-only

Qualifiers: MappingStrings («Win32Registry|System\\CurrentControlSet\\Control\\Session Manager\\Memory Management|TempPageFile»)

If true, a temporary page file has been created, usually because there is no permanent page file on the current computer system.

Remarks

The Win32_PageFileUsage class is derived from CIM_LogicalElement.

Configure the page file for best performance

When using Windows NT operating systems, then the best configuration for the pagefile is to let Windows handle it by setting it to be system managed. So unless having a very special system configuration, then one should just leave the pagefile alone.

When using Windows 9x operating system, then one can consider to set a custom size for the page file. The system managed page file in Win9x is constantly resized depending on the memory load, which increases file fragmentation.

Why using a page file?
How does virtual memory and the page file work?
Why is the performance of the page file not important?
How to calculate the necessary page file size?

Windows will by default configure the pagefile size to be 1.5 times the total RAM (With a maximum of 3 times of total RAM), and this will satisfy most computer configurations. The default configuration of 1.5 times the total RAM comes from the Windows Server environment, where the page file is used for complete memory dump analysis. More Info MS KB254649 MS KB237740

Читайте также:  Python для системных администраторов windows

The term «commit charge» specifies how much memory the system is using a the moment. If the commit charge is higher than the available RAM, then the system performance will be low (Recommended to have enough RAM to handle peak commit charge). If the commit charge comes close to the total amount of memory available (RAM + pagefile) then applications will start crashing, and Windows might crash as well.

  • To monitor the commit charge use the Task Manager (CTRL+SHIFT+ESC) and go to the Performance-tab. The Commit Charge (K) Peak shows the maximum memory usage since system start, and usually one should have more RAM installed than this number. There are also some pretty graphs that will show the current commit charge:
    • Windows XP/2003 — «PF Usage» and «Page File Usage History».
    • Windows 2000/NT4 — «MEM Usage» and «Memory Usage History».
    • Windows Vista — Doesn’t show any graph and the commit charge value have been renamed to «Page File — Value1 / Value2», where Value1 is the commit charge and Value2 is the actual pagefile size.

Unless doing full memory dump analysis, then the pagefile should only work as a buffer in the situation where the commit charge becomes higher than the available RAM. There is no golden rule for how to calculate the size of the pagefile, but here is one from Microsoft:

  1. Set your pagefile to be system managed
  2. Use your computer like you normally do by running your favorite applications and games
  3. After using the computer a few hours then check the page file peak usage. WinXP-2K_Pagefile.zip contains a VB Script that can display the current size of the pagefile, but also the peak size.
    • Minimum page file should be 1.7 times the page file peak size.
    • Maximum page file should be twice the minimum page file size.

More Info MS KB889654
More Info MS Technet — Understanding Memory Usage in Windows 2000

Where to place the page file ?
  • Pagefile type:
    • Dynamic, where the pagefile grows depending on memory load:
      • Minimum size is 0 and maximum size must satisfy the extreme memory load.
      • Will only take disk space when needed.
      • The resizing will increase file fragmentation, thus overall disk access will become slower over time.
      • The max memory load is dependent on disk space available.
    • Permanent, where the pagefile max. and min. size is the same:
      • Minimum size and maximum size is the same and must satisfy the extreme memory load.
      • Will have to take a lot more disk space than there is needed.
      • The permanent size will avoid file fragmentation.
      • The max memory load is dependent on the permanent size.
    • Semi-permanent, where the pagefile has an initial permanent size but can grow if needed:
      • Minimum size satisfies the common memory load and maximum size must satisfy the extreme memory load.
      • Will take a little more disk space than there is usual needed, by its initial size.
      • Only when the memory load peaks, then it will cause file fragmentation.
      • The max memory load is dependent on disk space available.
  • Pagefile disk:
    • Primary-disk, where the pagefile is placed on the same disk as the operating system:
      • Will share the disk with the other applications (Like the operating system).
    • Separate-disk, where the pagefile is placed on its own disk:
      • The operating system and the pagefile should always be placed on the fastest disk, so unless the separate-disk has the same speed as the primary-disk, then the it will not be the optimal setup.
      • Will have the disk for itself, at least until other files are placed on the disk, so make sure to only use it for storage (Movies/Music/etc.).
      • If the separate disk only contains the pagefile, then one can increase the performance by enabling write-caching for the hard disk.
      • Note that if it is an IDE HDD system, and the separate-disk is placed as slave on the same IDE-cable as the primary-disk, then it will slowdown the disk-access for both disks.
    • Multiple-disks, where the pagefile is spanned over several partitions on different disks:
      • Like with the separate-disk, the pagefile should only be placed on the fastest disk(s).
      • Will divide the pagefile load to several disks.
      • The internal algorithm that decides which pagefile to use, will choose the pagefile on the disk that less frequently used. Ensure that the disks used for pagefiles are not heavily accessed.
    • RAM-disk, where the pagefile is placed in the physical memory:
      • Requires that one have enough RAM to satisfy twice the common memory load.
      • Will lower the limit for when the paging algorithm will start paging to free up memory for file caching.
      • The paging algorithm will spend unnecessary time on moving data from one part of the RAM to the other, when reaching the limit on the available physical memory.
    • RAID-disks, where the pagefile is placed on a partition spanned over several disks:
      • RAID-0 gives best performance when doing sequential read/write, this doesn’t help the pagefile as it is accessed randomly thus dependent on HDD seek time
      • RAID-1 gives best performance when doing sequential read and gives fault tolerance, this doesn’t help the pagefile as it is accessed randomly thus dependent on HDD seek time, and the fault tolerance introduces a write overhead.
  • Pagefile partition:
    • Primary-Partition, the first partition on the disk:
      • Normally the fastest partition, as it is placed on the outer tracks on the disk.
      • A dynamic pagefile will cause fragmentation.
      • A permanent pagefile will always occupy more space than needed. This means that the fastest location on the HDD is wasted, instead of being used for files that are frequently paged into memory like DLL- and EXE-files.
      • To lower HDD seek time to the files frequently paged into memory (Operating System, Applications, Pagefile), then the primary partition should be sized to fit these files so they are grouped together. Storage files (Music/Movies/etc.) should be placed on a separate partition as they are not very dependent on HDD seek times.
    • Dedicated-Partition, where the pagefile is placed on its own partition:
      • Normally slower than the primary partition, as it is placed after the primary partition.
      • Will still share the disk with the other applications, when they access files on the other partitions. (Like the operating system).
      • A dynamic or semi-permanent pagefile will get the advantages/disadvantages of a permanent pagefile:
        • The pagefile will not become fragmented.
        • Will take more disk space than there is normally needed.
Читайте также:  Microsoft windows server cal 2019 mlp 5 device cal 64 bit eng box
What is the best pagefile configuration?

Most people will get the best configuration by using a Semi-Permanent-pagefile, which is placed on the C-Drive along with the operating system (Primary-Partition on the Primary-Disk). The minimum size of the pagefile should support the usual maximum memory load of when running your favorites applications and/or games. This is the default configuration of the Windows NT operating systems, and one should keep the page file set to «System Managed Size».

  • If having another physical hard disk available besides the primary hard-disk and it is just as fast, then one can consider to split the pagefile over both hard-disks. One should ensure that the extra hard disk is not frequently accessed by other applications.

Note the partition used for the pagefile should be formatted with a cluster-size, which is equal or larger than the size of a memory page (Usually 4 KByte). If smaller then it is required to access several clusters when reading/writing a memory page.

Note the access to the pagefile is mostly random and not sequential, so fragmentation in the pagefile doesn’t matter much, unless the pagefile have been completed shattered in small fragments over the entire disk. If still wanting to make continuous pagefile, then disable the pagefile or move the pagefile to another partition, and defragment the intended partition before creating the pagefile. Another solution is the utility PageDefrag

Note WinNT+ will not be able to create a proper memory dump for debugging purpose if the pagefile is disabled or too small. The pagefile is accessed with low level file operations to avoid the NTFS overhead. This allows use of the pagefile to save the dump even if the rest of the subsystems have crashed. Therefore if the pagefile is too small, then it cannot be used to contain the dump.

Читайте также:  0x8007035 windows 10 доступ по сети
How to configure the page file properties in Windows

To setup pagefile in Win9x MS KB259184:

  1. Start Button -> Settings -> Control Panel -> System -> Performance tab -> Virtual Memory.
  2. Select «Let me specify my own virtual memory settings».
  3. Set minimum and maximum size.

To setup pagefile in WinNT MS KB123747:

  1. Start Button -> Settings -> Control Panel -> System -> Performance tab.
  2. Under «Virtual Memory» press the «Change. » button.
  3. Check «Let me specify my own Virtual Memory Settings».
  4. Set initial and maximum size.

To setup pagefile in Win2k MS KB123747:

  1. Start Button -> Settings -> Control Panel -> System -> Advanced tab.
  2. Under «Performance» press «Performance Options. » button.
  3. Under «Virtual Memory» press «Change. » button.
  4. Set initial and maximum size.

To setup pagefile in WinXP MS KB307886:

  1. Start Button -> Control Panel -> Performance and Maintenance -> System -> Advanced tab.
  2. Under the «Performance» section press «Settings» button.
  3. Under the «Virtual Memory» section press the «Change. » button.
  4. Set initial and maximum size (or just select «System Managed Size»).

To setup pagefile in Vista WindowsHelp:

  1. Start Button -> Control Panel -> System-applet -> Advanced System Setting-task -> Advanced-tab -> Performance Settings. -button -> Advanced-tab -> Virtual Memory Change. -button (phew).
  2. Untick «Automatically manage paging file size for all drives»
  3. Set initial and maximum size (or just tick «Automatically manage paging file size for all drives» back again, and leave it be).

Note in WinNT+ there is an option to Clear the Windows Paging File at Shutdown (MS KB182086) and it is not recommended for the home user. It will increase the time it takes to shutdown because it has to write zero’s in the whole pagefile on the HDD. The reason for enabling clearing is to avoid that a very skilled person can open the pagefile and spy on the things you were doing while logged in (It requires that the person has physical access to the machine).

Оцените статью