Windows pagefile size with large RAM and SSD

4,305

Solution 1

I have 32GB of system RAM and a 256GB SSD, so I wondered the same thing. It does seems safe to change this, since even the dialog itself, at System Properties | Performance Options | Virtual Memory indicates:

Total paging file size for all drives

  • Minimum allowed: 16 mb
  • Recommended: 7,676 mb
  • Currently allocated: 32,768 MB

When defaulted to "system managed size", it was at the maximum of 32768 equivalent to memory size.

I changed it to the "recommended" value so it is now set to range between 7676 - 32768 instead of fixed at 32768:

Virtual Memory page file settings

I'll have to reboot and see if this helps. Edit: rebooted, confirmed, pagefile is now 7GB instead of 32GB. Success!

Since the "why have a paging file at all with that much memory" argument always comes up, it is advisable to have some page file, for the reasons that Mark Russinovich outlines:

Perhaps one of the most commonly asked questions related to virtual memory is, how big should I make the paging file? There’s no end of ridiculous advice out on the web and in the newsstand magazines that cover Windows, and even Microsoft has published misleading recommendations. ...

Some feel having no paging file results in better performance, but in general, having a paging file means Windows can write pages on the modified list ... out to the paging file, thus making that memory available for more useful purposes (processes or file cache). So while there may be some workloads that perform better with no paging file, in general having one will mean more usable memory being available to the system (never mind that Windows won’t be able to write kernel crash dumps without a paging file sized large enough to hold them).

That is why I advocate the recommended paging file size, or at least ½ the recommended size if you are absolutely, positively sure the peak commit charge (max real world memory usage) of the apps you typically use fits in the memory you have. Read the section titled How Big Should I Make the Paging File? in that article for more, it is the definitive statement on the matter. If you'd like to read even more, try this excellent Server Fault question.

Solution 2

The best advice for setting the Paging File size (of course) comes from Mark Russinovich. On his site he describes how to use his excellent tool SysInternals Process Explorer to determine the optimal Paging File size for your machine:

"So how do you know how much commit charge your workloads require? You might have noticed in the screenshots that Windows tracks that number and Process Explorer shows it: Peak Commit Charge. To optimally size your paging file you should start all the applications you run at the same time, load typical data sets, and then note the commit charge peak (or look at this value after a period of time where you know maximum load was attained). Set the paging file minimum to be that value minus the amount of RAM in your system (if the value is negative, pick a minimum size to permit the kind of crash dump you are configured for). If you want to have some breathing room for potentially large commit demands, set the maximum to double that number."

Source: https://web.archive.org/web/20130118041656/http://blogs.technet.com/b/markrussinovich/archive/2008/11/17/3155406.aspx

I have been using this method for years.

Solution 3

Probably you have the initial size of the swap file quite high, Windows tends to use a high value by default because if offers better performance. Put the initial size to a small size (in your case I suppose that "small" are 1 or 2 GB) and maintain the maximum value in 24 GB. (If you note that Windows always grows the file over the initial size you should use a higher value).

The trick here is changing the initial value, not the maximum value. If Windows grows the swap file is because it needs that memory.

Solution 4

As I have seen some atricles on the Net recommending NOT to delete the swap file, and as I'm convinced that during normal operation that memory is enough, what I resorted to was to move the swap file to my non SSD drive. This is a 2TB drive, so I just left it as "system managed" size.

P.S. I did notice that the swap file IS used when the computer wakes up after sleep.

Solution 5

It depends on your workload. Run all your programs that you usually run (at maximum load) and check virtual memory usage (e.g. with Process Explorer). Just limit your virtual memory to number there. Even if you do not use any virtual memory at all, leave some of it assigned - it helps with memory dumps and memory-mapped files.

Share:
4,305

Related videos on Youtube

michdraft
Author by

michdraft

Updated on September 17, 2022

Comments

  • michdraft
    michdraft over 1 year

    I have created a jasperreports in almost the same size of A6(width = 595 height = 842)format and i want it be printed on the A4 in portrait and in the middle but it prints always in landscape on A4. I use ireport 5.5.0 and jasperreport 5.5.0 to create and display it by java.

    Any help will be appreciated.

    • Amir Pashazadeh
      Amir Pashazadeh over 10 years
      Your report is designed in A6? WHy don't you change the printer settings then?
    • michdraft
      michdraft over 10 years
      It is almost the same size of A6(width = 595 height = 842). this is the reason why I do print it on A4.
    • Alex K
      Alex K over 10 years
  • uxout
    uxout over 13 years
    I do NOT recommend such a hugely variable size on an SSD, because if the wear leveling on your drive is crappy you have the potential to really reduce the lifetime of the drive in the (very unlikely) event you use most of that paging.
  • uxout
    uxout over 13 years
    Er, to clarify my comment, my recommendation is generally to make the minimum and maximum sizes the same, so it's a fixed file size. This is also nice on slower platter drives to reduce head thrashing and disk fragmentation. I'd recommend 4GB myself but 2 is probably fine.
  • Alberto Martinez
    Alberto Martinez over 13 years
    Thats why I said "If you note that Windows always grows the file over the initial size you should use a higher value". Since he is trying to save disk space there is no point in using a 4GB initial size if 99% of the time Windows never use more than, say, 1.2 GB. In other situations I would agree with you that is better use a bigger initial size for the reasons you mention.
  • Louis Waweru
    Louis Waweru almost 12 years
    "With the faster throughput achieved using SSD technology, the swapfile is a much less critical component." This doesn't make sense.
  • Avi
    Avi over 11 years
    I've checked my computer. It turns out that a long time ago I set the initial size to 16MB and the maximum size to 5,120 MB, on both SSD drives C and D. It's now working perfectly, with currently 32 MB allocated.
  • dkackman
    dkackman over 11 years
    I recall reading to not have a page file on an SSD because of the write wear issue (or whatever thats called). Has that problem gone away?
  • Binary Phile
    Binary Phile over 11 years
    Agreed, if there is another drive without space constraints, that sounds preferable for the page file. In any case, when you have 32GB of RAM, unless you routinely run at 98% memory usage, I'd consider eliminating the page file altogether. The system will warn you if you're running low on virtual memory, and you can probably find a couple apps to close. Pagefile is just insurance nowadays.
  • Giscard Biamby
    Giscard Biamby over 11 years
    I'm on Win7 with 16GB RAM, and the windows "recommended" setting is 24GB.
  • Giscard Biamby
    Giscard Biamby over 11 years
    Another similar change you can make, if you don't use hibernate, is to disable hibernate via the powercfg -h off command (requires administrator / elevated command prompt). c:\hiberfil.sys is roughly equal to the amount of RAM you have by default, so disabling hibernate saves that disk space. However, even though boot time is fast enough with an SSD that you don't need hibernate, I still use hibernate because I like to keep the state of my apps across sessions.
  • pseudosavant
    pseudosavant over 11 years
    A 1:1 ratio between physical RAM and pagefile size never made sense. It looks like Windows 8 fixes this behavior. My Windows 8 machine has 8GB of RAM and the automatic settings have the pagefile size as 16MB min, 4543MB max, and 1216MB currently allocated.
  • michdraft
    michdraft over 10 years
    I have changed Page Setup too but has no effect on the report preview and end printed result because i use java to print the report not the ireport. I use ireport to design the report, and any changes to the page setup in ireport has no effect in my_report.jrxml and my_report.jasper
  • Twinbee
    Twinbee over 5 years
    Why not just set the pagefile size to whatever giant size you want (like 100GB) if you have terabytes of SSD space?
  • Mass Dot Net
    Mass Dot Net about 3 years
    The "How Big Should I Make the Paging File?" link in OP is dead/broken.