This topic was translated by AI and is currently in queue for revision by our editors. Alibaba Cloud does not guarantee the accuracy of AI-translated content. Request expedited revision

How do I configure the virtual memory of a Windows instance?

Updated at: 2025-03-26 09:39

In Windows systems, virtual memory is typically referred to as a paging file (Pagefile). When the memory of a Windows system cannot meet the requirements of all currently running processes, the system transfers some infrequently used data from memory to virtual memory on the hard disk. Properly configuring virtual memory can improve system performance and stability.

Important

Enabling virtual memory may degrade memory I/O performance. When an ECS instance has insufficient memory, we recommend that you modify the instance type to increase memory. If you need to enable virtual memory based on your business requirements, follow the guidelines in this topic for configuration.

Scenarios

The following are common scenarios that may require enabling virtual memory.

  • Insufficient memory or high memory usage

    • If your system has limited memory (such as 4 GB or less), you may frequently encounter out of memory incidents. In this case, you can enable virtual memory to help the system handle more concurrent tasks or applications.

    • If system monitoring tools indicate that memory usage is frequently near 100%, you can consider increasing memory or enabling virtual memory to ensure system stability. Otherwise, some applications or the system may crash.

  • Running large applications or multitasking

    Running large graphic and design software (such as Adobe Photoshop), data analysis software (such as big data analysis tools), games, and other applications typically requires substantial memory. Enabling virtual memory ensures that these applications run smoothly.

Configuration recommendations

Location of virtual memory

  • Avoid using the C drive: We strongly recommend avoiding placement of the paging file on the C drive (usually the system disk). The C drive typically stores operating system and application files and has limited disk space. Configuring the paging file on the C drive may lead to system performance degradation and availability issues.

  • Use other partitions: We advise configuring virtual memory on partitions other than the C drive to reduce the load on the C drive and enhance the efficiency of virtual memory access.

Size of virtual memory

  • Automatic management of virtual memory: We recommend that you allow the system to automatically manage the size of virtual memory. Windows can dynamically adjust the size of the paging file based on current system usage to optimize performance.

  • Custom virtual memory settings: If you have specific requirements, we recommend that you set the initial and maximum values of virtual memory based on the memory size.

    • Initial size: Set it to 1 to 1.5 times the size of memory to provide sufficient space to handle memory requirements in most situations without frequent adjustments to the paging file size.

    • Maximum size: Set it to 2 to 3 times the size of memory to provide sufficient buffer space to ensure that the system can still run normally under high load conditions.

Other recommendations

  • Monitor performance: Regularly monitor system performance, especially when running large applications or games. If you find that the system frequently uses virtual memory, you should consider increasing memory.

  • Prevent fragmentation: Regularly defragment the disk to reduce fragmentation issues and ensure the efficiency of virtual memory operations.

  • Ensure normal system operation: Check which applications are using virtual memory to ensure they are running properly.

Configure virtual memory

Note

This procedure uses Windows Server 2016 as an example. Your actual environment may vary.

  1. Use Workbench to connect to a Windows instance over RDP.

  2. On the Windows Server desktop, right-click the image icon, and then click System.

  3. Select Advanced System Settings.

  4. In the Advanced tab, click Settings in the Performance section.

    image

  5. In the Advanced tab, click Change in the Virtual Memory section.

    image

  6. In the Virtual Memory dialog box, select Automatically manage virtual memory, Custom virtual memory settings, or Disable virtual memory based on your actual needs.

    • Automatically manage virtual memory

      1. Select Automatically Manage Paging File Size For All Drives.

      2. Click OK to complete the configuration.

      image

    • Custom virtual memory settings

      1. Uncheck Automatically Manage Paging File Size For All Drives.

      2. Select the drive where the virtual memory file will be stored.

      3. Select Custom Size, enter the Initial Size and Maximum Size, and then click Set.

      4. Click OK to complete the configuration.

      image

    • Disable virtual memory

      1. Uncheck Automatically Manage Paging File Size For All Drives.

      2. Select the drive where the virtual memory file is stored.

      3. Select No Paging File, and then click Set.

      4. Click OK to complete the configuration.

      image

  7. Restart the ECS instance for the configuration to take effect.

  • On this page (1)
  • Scenarios
  • Configuration recommendations
  • Configure virtual memory
Feedback