Updated: 12 October 2026 · Applies to: Windows 11, Windows 10 and Windows Server with Desktop Experience (steps from Microsoft's documentation, as Windows does not run in our Linux test lab); file size commands tested on Ubuntu 24.04 and 26.04
To make the page file larger in Windows, press Windows+R, type SystemPropertiesAdvanced and press Enter. Under Performance select Settings, open the Advanced tab and select Change under Virtual memory. Clear Automatically manage paging file size for all drives, select Custom size, enter a larger Initial size (MB) and Maximum size (MB), select Set, then OK, and restart. The page file (pagefile.sys, a hidden file on the system drive) is the disk space Windows uses as extra virtual memory when RAM is full.
Looking for a way to make an ordinary file bigger, for example a test file of an exact size? See the last section, Make any file larger.
Increase the page file size step by step
These steps follow Microsoft's own instructions and are the same on Windows 11, Windows 10 and Windows Server with the desktop. You need an administrator account.
- Open System Properties: press Windows+R, type
SystemPropertiesAdvancedand press Enter. (Or press Windows+Pause/Break and select Advanced system settings.) - On the Advanced tab, under Performance, select Settings.
- In Performance Options, open the Advanced tab and select Change in the Virtual memory section.
- Clear the Automatically manage paging file size for all drives check box.
- Select the drive that holds the page file (normally
C:), then select Custom size. - Enter the new Initial size (MB) and Maximum size (MB). Sizes are in megabytes: 8 GB is 8192 MB, 16 GB is 16384 MB.
- Select Set, then OK in each window.
- Restart Windows. Microsoft's steps end with a restart. If you make the page file smaller, a restart is always needed before the change takes effect.
To go back to the default, tick Automatically manage paging file size for all drives again, select OK and restart.
How large should the page file be?
According to Microsoft, there is no single right size: it depends on how much memory your programs use at peak and on the crash dump setting.
- Out-of-memory errors: Microsoft's fix for errors caused by slow page file growth is a fixed custom size, starting with an initial size of 1.5 times the installed RAM. Increase the initial size further if the errors continue.
- Peak use: the commit limit is RAM plus all page files. Open Task Manager, select Performance and then Memory: Committed shows the current commit charge and the limit. If the charge gets close to the limit at busy times, make the page file larger.
- Crash dumps: a complete memory dump needs a page file of at least the RAM size plus 257 MB. The default setting, automatic memory dump, starts with a much smaller page file.
- System-managed default: in Windows 10 and 11 an automatic page file can grow to 3 times the RAM or 4 GB (whichever is larger), limited to one eighth of the volume size.
Setting the initial and maximum size to the same value gives a fixed page file that never has to grow while programs wait. Keep enough free space on the drive: the page file takes its full initial size on disk.
Check the current page file size
In PowerShell (sizes in MB, according to Microsoft's WMI class reference):
Get-CimInstance Win32_PageFileUsage | Select-Object Name, AllocatedBaseSize, CurrentUsage, PeakUsage
AllocatedBaseSize is the disk space the page file has now, CurrentUsage and PeakUsage the current and highest use. If the peak is close to the size, a larger page file helps.
Windows Server Core or a script
Without the desktop, set the size in PowerShell as administrator. Microsoft's WMI reference documents both properties as writable; we could not run these two commands in our lab, so check the result with the command above after a restart:
Get-CimInstance Win32_ComputerSystem | Set-CimInstance -Property @{AutomaticManagedPagefile = $false}
Get-CimInstance Win32_PageFileSetting | Set-CimInstance -Property @{InitialSize = 8192; MaximumSize = 8192}
Older guides use wmic pagefileset. Microsoft has removed WMIC from current Windows 11 releases, so use PowerShell instead.
On a Ucartz Windows VPS
On a Ucartz Windows VPS, Windows Server is available on VPS Pro and Elite with the licence included, and our engineers install it after you order. The page file steps above work the same there. A page file is not a replacement for RAM: if Windows uses it heavily all day, a plan with more memory is the better fix. On a Linux server the same job is done by swap: see How to Increase Swap Space with a Swap File in Linux.
Make any file larger
To make an ordinary file bigger, for example to create a test file of an exact size or pad a file to a minimum size, use these commands. They add zero bytes to the end of the file; the existing content stays as it is.
Windows (Command Prompt as administrator, sizes in bytes, according to Microsoft's fsutil reference):
fsutil file createnew C:\temp\test.bin 1073741824 fsutil file seteof C:\temp\notes.txt 104857600
The first command creates a new 1 GB file filled with zeros, the second grows an existing file to 100 MB.
Linux (tested on Ubuntu 24.04 with GNU coreutils 9.4 and on Ubuntu 26.04, whose truncate is uutils 0.10.0, with the same results):
$ printf 'hello\n' > notes.txt $ truncate -s 100M notes.txt # set the size to 100 MB $ ls -lh notes.txt; du -h notes.txt 100M notes.txt 4.0K notes.txt $ head -c 6 notes.txt hello $ truncate -s +50M notes.txt # add 50 MB to the current size $ ls -lh notes.txt 150M notes.txt $ fallocate -l 1G big.img # 1 GB file with the disk space reserved $ ls -lh big.img 1.0G big.img
truncate makes a sparse file: the size grows at once but almost no disk space is used (4.0K in du). Use fallocate when the space must really be reserved, or append real zeros with dd if=/dev/zero bs=1M count=200 >> notes.txt. Be careful with a smaller size: truncate -s 10M on a larger file cuts off everything after 10 MB.