How can I shrink my 12GB pagefile.sys?

27

8

Even though I only have 4GB of RAM, I have a 12GB pagefile.sys. From what I've read about the topic, this is bigger than the x1.5 rule-of-thumb and it's also taking a huge chunk of space on my hard drive. I tend to run a lot of applications and tabs withing web browsers, so the last time this happened, I closed everything down and restarted my computer. When I ran WinDirStat again later the pagefile was down to 3-4GB. Now my pagefile is up to 12GB again and closing programs/restarting is not working.

My first question is what actions cause pagefile.sys to grow so large in relation to the installed RAM (computer on for long amounts of time, too many programs running, too many browser tabs open)? Second, how can I get my pagefile.sys down to 6-7GB?

I'm running Windows 7 Home Premium SP1 with 4GB of RAM

Elizabeth Frazier

Posted 2014-01-13T16:10:36.227

Reputation: 273

5Is the current setting to allow Windows to manage the size pagefile or have you configured it to be a specific size. Of course if Windows is creating a 12GB then it should to be that large. – Ramhound – 2014-01-13T16:17:55.983

2Part of the problem is you have so little RAM for the number of programs your using. When Windows runs out of REAL memory it uses swap file and it uses more and more swap file until its needs are met. – cybernard – 2014-01-14T00:34:40.140

Answers

22

You can manually limit the pagefile size by performing the following steps:

  1. Click on the Start button.
  2. Right click on Computer.
  3. Select Properties
  4. Click on Advanced system settings on the left.
  5. Click on the Settings button under the Performance group.
  6. Select the Advanced tab of the Performance Options window.
  7. Click on the Change button.
  8. Uncheck Automatically manage paging file size for all drives.
  9. Select the C: drive in the list.
  10. Check the Custom size radio button.
  11. Enter the Initial and Maximum sizes you want to use. I would recommend 4096 MB for the Initial and 6144 MB for the Maximum.
  12. Click OK on the Virtual Memory dialog.
  13. Click OK on the Performance Options dialog.
  14. Click OK on the System Properties dialog.

Drew Chapin

Posted 2014-01-13T16:10:36.227

Reputation: 4 839

So, multiply your GB of RAM by 1024 for the Initial and multiply that result by 1.5 for the Maximum? – 5ervant – 2019-06-01T14:46:28.703

9

You can force a Virtual Memory file size by:

  1. Left click on 'Start'.
  2. Right click on 'PC'.
  3. Left click on 'Properties'.
  4. Left click on 'Advanced system configuration'.
  5. If needed, left click on 'OK'.
  6. Select 'Advanced options' tab.
  7. Left click on 'Configuration' inside 'Throughput'.
  8. Select 'Advanced options' tab.
  9. Left click on 'Change' inside 'Virtual memory'.
  10. Edit your preferences.
  11. Close all the opened windows by accepting.

174140

Posted 2014-01-13T16:10:36.227

Reputation: 859

This sounds like very specific instructions for some OS version other than Windows 7. Are you sure this isn't for Vista, or Windows 8? – jpaugh – 2015-06-17T15:54:31.767

No, not at all. – 174140 – 2015-06-17T19:20:03.383

There is no 'Configuration' button or 'Throughput' group on the 'Advanced' tab. – Drew Chapin – 2016-01-20T19:42:15.470

I might have been guessing from five to nine. Upvoters please upvote more exact answer too.

– 174140 – 2016-01-21T09:33:08.117

0

If you have more than one partition, follow the steps indicated by uprego in his answer but also:

  • set the swap file to another partition (e.g. so no swap file parts on C:, all on D:)
  • reboot
  • do the same again setting the swap file back -reboot

This will recreate the swap file with your initial settings, so you can always force its size down this way (any fragmentation in the file will be removed). But it does not remove the cause of the big file; you will have to figure that out from other clues. As you already suggested, you probably have a lot of programs open at the same time, a lot of browser tabs, or you use memory-hungry applications.

BTW If you just want to remove fragmentation in the swap file use SysInternals' pagedefrag

Jan Doggen

Posted 2014-01-13T16:10:36.227

Reputation: 3 591

pagedefrag doesn't work on 64-bit Windows, which I sadly found out just yesterday. – Jürgen A. Erhard – 2014-12-16T19:13:36.250