The page file (C:\pagefile.sys) is disk space Windows uses as an extension of RAM, and as a place to write crash dumps. On a small Windows VPS it’s an important safety net: without it, applications crash with “out of memory” errors as soon as RAM runs out. Here’s how to size and configure it.
What the page file does
- Backs committed memory: Windows guarantees memory to programs (“commit”). The commit limit = RAM + page file size. When commit reaches the limit, allocations fail, and apps crash or refuse to start.
- Pages out idle memory, so active programs get more physical RAM.
- Stores crash dumps when the system bugchecks (blue screen), if configured.
Paging isn’t automatically bad. Heavy, constant paging (high “hard faults per second”) is the sign that the server needs more RAM.
Recommended settings
System managed size is the right choice for most servers. Windows grows the page file as needed:
Get-CimInstance Win32_ComputerSystem | Select-Object AutomaticManagedPagefile
Get-CimInstance Win32_PageFileUsage | Select-Object Name, AllocatedBaseSize, CurrentUsage, PeakUsage
If you set a custom size (for example to control disk usage on a small disk):
| RAM | Suggested page file |
|---|---|
| 2 GB | 2–4 GB |
| 4 GB | 4 GB |
| 8 GB | 4–8 GB |
| 16 GB+ | Based on the peak commit you observe, plus a margin |
Look at peak commit in Task Manager → Performance → Memory → “Committed” (used / limit). Size the page file so the limit stays comfortably above the peak.
Configure with PowerShell
# switch off automatic management, then set a fixed size (MB)
$cs = Get-CimInstance Win32_ComputerSystem
$cs | Set-CimInstance -Property @{ AutomaticManagedPagefile = $false }
$pf = Get-CimInstance Win32_PageFileSetting -Filter "Name='C:\\pagefile.sys'"
if (-not $pf) { $pf = New-CimInstance -ClassName Win32_PageFileSetting -Property @{ Name = 'C:\pagefile.sys' } }
$pf | Set-CimInstance -Property @{ InitialSize = 4096; MaximumSize = 4096 }
# reboot to apply
GUI: System Properties → Advanced → Performance Settings → Advanced → Virtual memory → Change.
Don’t disable it
Turning the page file off “to speed things up” or “save disk space” is a common mistake:
- the commit limit drops to physical RAM, so programs fail as soon as memory fills;
- some applications (SQL Server, Exchange, others) expect a page file;
- no crash dumps for troubleshooting.
On VPS.DO, Windows plans have at least 50 GB of disk, so a few GB for the page file is a good use of space. See Windows disk cleanup if space is tight.
Crash dump settings
System Properties → Advanced → Startup and Recovery: choose Automatic memory dump or Kernel memory dump (smaller than a complete dump). The page file must be large enough for the dump type. Delete old dumps (C:\Windows\MEMORY.DMP) after analysis.
Signs you need more RAM, not a bigger page file
- Committed memory near the limit most of the time.
- Constant high hard faults/sec (Resource Monitor → Memory) and slow responsiveness.
- Event ID 2004 (Resource-Exhaustion-Detector) in the System log. See Windows Event Viewer errors.
- RDP sessions and apps becoming sluggish when several users or programs run.
Then reduce memory use (cap SQL Server, close browsers, fewer charts in trading terminals), or upgrade the plan. See Windows Server performance tuning and when to upgrade your VPS.
Quick reference
| Task | How |
|---|---|
| Current usage | Get-CimInstance Win32_PageFileUsage |
| Recommended | System managed |
| Custom size | Win32_PageFileSetting Initial/MaximumSize, then reboot |
| Commit used/limit | Task Manager → Memory → Committed |
| Never | Disable it on a small VPS |
Related: how much RAM a VPS needs and Windows VPS.