Manage Virtual Memory Pagefile in Windows 10  

Page 1 of 2 12 LastLast
    Manage Virtual Memory Pagefile in Windows 10

    Manage Virtual Memory Pagefile in Windows 10

    How to Manage Virtual Memory Pagefile in Windows 10
    Published by Category: Virtualization
    29 Aug 2022
    Designer Media Ltd

    How to Manage Virtual Memory Pagefile in Windows 10


    Paging is a memory management scheme by which a PC stores and retrieves data from secondary storage for use in main memory. In this scheme, the operating system retrieves data from secondary storage in same-size blocks called pages. Paging is an important part of virtual memory implementations in modern operating systems, using secondary storage to let programs exceed the size of available physical memory.

    For simplicity, main memory is called "RAM" (abbreviated from "random-access memory") and secondary storage is called "disk" (a shorthand for "hard disk drive"), but the concepts do not depend on whether these terms apply literally to a specific computer system.

    Virtual memory is a memory management technique that is implemented using both hardware and software. It maps memory addresses used by a program, called virtual addresses, into physical addresses in computer memory. Main storage as seen by a process or task appears as a contiguous address space or collection of contiguous segments. Windows manages virtual address spaces and the assignment of real memory to virtual memory. Address translation hardware in the CPU, often referred to as a memory management unit or MMU, automatically translates virtual addresses to physical addresses. Software within Windows may extend these capabilities to provide a virtual address space that can exceed the capacity of real memory and thus reference more memory than is physically present in the computer.

    Virtual memory is dynamic. This means that Windows will use more or less virtual memory on the fly as needed by the system. It is recommended that you allow Windows to manage this space unless you have a really good reason to change it (rarely necessary).

    The primary benefits of virtual memory include freeing applications from having to manage a shared memory space, increased security due to memory isolation, and being able to conceptually use more memory than might be physically available, using the technique of paging.

    Basically, a paging file is an area on the hard disk that Windows uses as if it were RAM in addition to the install RAM.

    References:

    By default, Windows automatically manages the pagefile settings for you, but there may be times you may need to manually manage your pagefile. For example:
    • If the C: drive that Windows is installed on is small in size, you may wish to remove the pagefile from that drive, and add a paging file to another drive with more space instead.
    • If you use a lot of memory, then you may wish to add a pagefile to another drive to have available if needed.
    • If you don't use a lot of memory and your pagefile is large in size, you may wish to use a smaller custom size.
    • If you are getting a BSOD PAGE_FAULT_IN_NONPAGED_AREA or KERNEL_DATA_INPAGE_ERROR or Low Memory type error, you may need to use a larger custom size for the pagefile.

    This tutorial will show you how to manage the virtual memory paging file for each drive on your Windows 10 PC.

    You must be signed in as an administrator to be able to make changes to the pagefile.



    Contents

    • Option One: Manage Virtual Memory Paging File for All Drives in Advanced Performance Options
    • Option Two: Turn On or Off "Automatically manage paging file size for all drives" in Command Prompt
    • Option Three: Change Custom Size of Paging File for Specific Drive in Command Prompt



    EXAMPLE: pagefile.sys on Windows C: drive
    Manage Virtual Memory Pagefile in Windows 10-pagefile.sys.jpg






    OPTION ONE

    Manage Virtual Memory Paging File for All Drives in Advanced Performance Options


    1 Open the Control Panel (icons view), and click/tap on the System icon.

    Starting with Windows 10 build 20161, you will need to open Settings instead, click/tap on the System icon, and click/tap on About on the left side.

    You can also press the Win + R keys to open Run, type SystemPropertiesPerformance.exe into Run, and click/tap on OK to directly open Performance Options at step 4 below.


    2 Click/tap on the Advanced system settings link on the left side in System, and close the System window. (see screenshots below)

    Manage Virtual Memory Pagefile in Windows 10-virtual_memory_page_file-1.jpg Manage Virtual Memory Pagefile in Windows 10-settings_system.png

    3 In the Advanced tab, click/tap on the Settings button in the Performance section. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-virtual_memory_page_file-2.jpg

    4 In the Advanced tab, click/tap on the Change button in the Virtual memory section. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-virtual_memory_page_file-3.jpg

    5 Do step 6 (custom size), step 7 (remove), step 8 (system managed), or step 9 (all system managed) for how you want to manage the paging file on your drive(s).


    6 To Set a Custom Size for Paging File Size on a Specific Drive

    A) Uncheck the Automatically manage paging file size for all drives box. (see screenshot below step 6F)

    B) Select a drive (ex: C: ) you want to either set a custom size or add a paging file. (see screenshot below step 6F)

    C) Select (dot) Custom size. (see screenshot below step 6F)

    D) Enter the Initial size (minimal) you want in MB (1024 MB = 1 GB) for the paging file on the selected drive. (see screenshot below step 6F)

    E) Enter the Maximum size you want in MB (1024 MB = 1 GB) for the paging file on the selected drive. (see screenshot below step 6F)

    F) Click/tap on the Set button. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-custom_paging_file_for_drive-1.jpg

    G) Click/tap on OK. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-custom_paging_file_for_drive-2.jpg

    H) Click/tap on OK. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-virtual_memory_page_file-4.jpg

    I) Click/tap on OK. (see screenshot below step 4)

    J) Click/tap on OK. (see screenshot below step 3)

    K) Click/tap on Restart Now to restart the computer to apply your changes. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-virtual_memory_page_file-5.jpg


    7 To Remove (disable) Paging File on a Specific Drive

    A) Uncheck the Automatically manage paging file size for all drives box. (see screenshot below step 7D)

    B) Select a drive (ex: C: ) you want to remove a paging file from. (see screenshot below step 7D)

    C) Select (dot) No paging file. (see screenshot below step 7D)

    D) Click/tap on the Set button. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-remove_paging_file_for_drive-1.jpg

    E) Click/tap on Yes to confirm. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-remove_paging_file_for_drive-2.jpg

    F) Click/tap on OK. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-disable_paging_file_for_drive-3.jpg

    G) Click/tap on OK. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-virtual_memory_page_file-4.jpg

    H) Click/tap on OK. (see screenshot below step 4)

    I) Click/tap on OK. (see screenshot below step 3)

    J) Click/tap on Restart Now to restart the computer to apply your changes. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-virtual_memory_page_file-5.jpg


    8 To Set Size of Paging File on a Specific Drive to be System Managed

    A) Uncheck the Automatically manage paging file size for all drives box. (see screenshot below step 8D)

    B) Select a drive (ex: C: ) you want to have its paging file size system managed. (see screenshot below step 8D)

    C) Select (dot) System managed size. (see screenshot below step 8D)

    D) Click/tap on the Set button. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-system_managed_paging_file_for_drive-1.jpg

    E) Click/tap on OK. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-system_managed_paging_file_for_drive-2.jpg

    F) Click/tap on OK. (see screenshot below step 4)

    G) Click/tap on OK. (see screenshot below step 3)


    9 To Set Size of Paging File on All Drives to be System Managed

    A) Check the Automatically manage paging file size for all drives box, and click/tap on OK. (see screenshot below)

    Manage Virtual Memory Pagefile in Windows 10-system_managed_paging_file_for_all_drives.jpg

    B) Click/tap on OK. (see screenshot below step 4)

    C) Click/tap on OK. (see screenshot below step 3)






    OPTION TWO

    Turn On or Off "Automatically manage paging file size for all drives" in Command Prompt


    Turning on Automatically manage paging file size for all drives will remove any custom size set for paging files on all drives with a paging file, and have the paging file size automatically managed by the system for all drives with a paging file.


    1 Open an elevated command prompt.

    2 Copy and paste the command below you want to use into the elevated command prompt, and press Enter.

    (Turn on (default) "Automatically manage paging file size for all drives")
    wmic computersystem where name="%computername%" set AutomaticManagedPagefile=True

    OR

    (Turn off "Automatically manage paging file size for all drives")
    wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False

    3 You can now close the elevated command prompt.






    OPTION THREE

    Change Custom Size of Paging File for Specific Drive in Command Prompt


    1 Open an elevated command prompt.

    2 Copy and paste the command below into the elevated command prompt, and press Enter to turn off "Automatically manage paging file size for all drives".

    wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False

    3 Copy and paste the command below into the elevated command prompt, and press Enter. This will show you a list of which drives have a paging file, and what their Initial size (min) and Maximum size are currently set to in MB. (see screenshot below)

    wmic pagefileset list /format:list

    If the InitialSize and MaximumSize shows as currently set to 0 MB, then it means it is currently system managed.

    You can change these sizes in the next step for a custom size you want.

    Manage Virtual Memory Pagefile in Windows 10-wmic_pagefileset_list.png

    4 Type the command below into the elevated command prompt, and press Enter.

    wmic pagefileset where name=”<drive letter>:\\pagefile.sys” set InitialSize=<custom min size>,MaximumSize=<custom max size>

    Substitute <drive letter> in the command above with the actual drive letter (ex: "C") for the paging file from step 3 you want to set a custom size.

    Substitute <custom min size> in the command above with the custom initial (minimum) size you want in MB (ex: "16") for the paging file on the specified drive (ex: "C").

    Substitute <custom max size> in the command above with the custom maximum size you want in MB (ex: "4985") for the paging file on the specified drive (ex: "C").

    For example: wmic pagefileset where name=”C:\\pagefile.sys” set InitialSize=16,MaximumSize=4985


    5 Close the elevated command prompt.

    6 Restart the computer to apply.


    That's it,
    Shawn






  1. Posts : 9
    Windows 10x64 Ultimate
       #1

    HI,
    Thanks for exact explanainsion but I'm still a little confused. Which option is the best in my sytuation?
    1.To Set a Custom Size for Paging File Size on a Drive
    2.To Remove (disable) Paging File on a Drive
    3.To Set Size of Paging File on a Drive to be System Managed
    4.To Set Size of Paging File on All Drives to be System Managed
    and what value is the best in my case?
    Thanks in advance for any sugestions !!!!
      My Computer


  2. Posts : 68,967
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    Hello oxixx,

    I posted an answer for this in your other thread below to help.

    Physical and Virtual Memory
      My Computers


  3. Posts : 158
    10 Home x64 v22H2
       #3

    I'm trying to move my pagefile to another drive, but whenever I reboot I get this message.

    Manage Virtual Memory Pagefile in Windows 10-image.png
      My Computer


  4. Posts : 68,967
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

    Supra said:
    I'm trying to move my pagefile to another drive, but whenever I reboot I get this message.
    Hello Craig,

    Please go ahead and post a screenshot showing your pagefile settings to see if anything may stand out.
      My Computers


  5. Posts : 158
    10 Home x64 v22H2
       #5

    Brink said:
    Hello Craig,

    Please go ahead and post a screenshot showing your pagefile settings to see if anything may stand out.
    Manage Virtual Memory Pagefile in Windows 10-image.png
      My Computer


  6. Posts : 68,967
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #6

    @Supra,

    As a test, select System managed size and click on OK to see if it may stop trying to create a temp page file on "C" after restarting the computer.
      My Computers


  7. Posts : 158
    10 Home x64 v22H2
       #7

    Nope, that didn't seem to help. However I think it works on my NVMe drive, I'd just prefer it to be on my mechanical "Black" drive. Not sure if that will effect performance badly but I was prepared to experiment.
      My Computer


  8. Posts : 186
    Windows 10 Pro x64 21H2
       #8

    Question: If I leave "Automatically manage paging file size for all drives" checked, where will the pagefile be stored? I have 4 drives--C:\, D:\, E:\, and P:\--and I'm assuming that Windows would just put the pagefile on C:\ if this option is checked, correct?
      My Computer


  9. Posts : 68,967
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #9

    TONPumper said:
    Question: If I leave "Automatically manage paging file size for all drives" checked, where will the pagefile be stored? I have 4 drives--C:\, D:\, E:\, and P:\--and I'm assuming that Windows would just put the pagefile on C:\ if this option is checked, correct?
    Hey mate,

    It would depend on what you had set for each drive before checking "Automatically manage paging file size for all drives".

    A pagefile will be stored on each drive you have it turned on for.
      My Computers


 

Tutorial Categories

Manage Virtual Memory Pagefile in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:22.
Find Us




Windows 10 Forums