My Windows PC alerted me with low harddisc space, and when I scan hard drives with TreeSize tool, I realize that windows keeps a huge pagefile.sys file, that is 18.2 GB and keep growing.
Why is this pagefile is so big and how can I limited it to a specific max. size like 5 GB maxmium?
92 Answers
- Open the System Properties dialog (right-click
Start,System, selectAdvanced system settingson the right).
- On the
Advancedtab, clickSettingsunder the performance section
- On the
Advancedtab ofPerformance OptionsclickChangeunder theVirtual memorysection
- Disable
Automatically manage paging file size for all drives - Use the
Custom sizeradio button to open up theInitial sizeandMaximum sizefields
- Specify your values, taking heed of the
Recommendedvalue at the bottom of the dialog, clicksetand close the dialog boxes.
If you have additional drives, you can also specify a different disk for the pagefile. This is preferable when you have an SSD as your boot drive, as paging to file frequently can reduce the life of an SSD.
2Attention: The pagefile is required for Windows full functionality.
For example, in case of a crash (BSOD), Windows will keep the crash dump in the pagefile until the computer is restarted. A too small pagefile will effectively mean disabling crash dumps.
As another example, the system commit limit is the sum of physical memory (RAM) and all page files combined. This limit is the maximal memory amount that can be allocated to Windows and all tasks. If the pagefile is too small, tasks won't be able to ask for much more memory than the available RAM.
Your pagefile is currently being managed by Windows, so it will increase in size according to the needs of the running processes. Its large size might mean that your workload requires more memory than is physically available.
I recommend reading the Microsoft article of
How to determine the appropriate page file size for 64-bit versions of Windows.
Before reducing the pagefile too much, you may also:
- Add more RAM, or
- Allocate page file space on another disk than
C:.
The total page files space on all disks that I recommend is RAM plus 257 MB, enough for a complete crash dump. Although many recommendations say rather 1.5 times the RAM, I believe that if the RAM is large (as available on modern computers), the above amount should be enough.
2