Why has reducing the size of the page file made my Windows work so smoothly?

1

I have a Lenovo W500s Notebook with 16GB RAM, a 250GB SSD and Windows 10 Pro. Until recently it was performing really, really bad. I couldn't believe that this machine runs so bad so I was googling and googling and googling and tried all possible and popular system optimizations out like disabling services, removing unnecessasry software, tuning energy settings, setting the nVidia physX processor to the dedicated graphic card... nothing worked until I found an article on reddit suggesting reducing the system virtual memory to a fixed size recommended by the system itself.

fixed-paging-file

Since then I no longer recognize my notebook because everything works so smoothly. There are no lags when scrolling webpages, applications start immediately, windows checks for updates within seconds and not minutes, Visual Studio 2017 runs and starts so fast that I almost think it's not the same machine.

I wonder why is this so? Why does Windows work so much better now then before while having a 8GB self-managed paging file? Why does everyone keep the myth alive that it's better to let Windows manage this file itself and what wonders me most is why Windows uses a paging file much, much larger then the Recommended size even though it slows it down?

t3chb0t

Posted 2017-08-12T10:53:06.377

Reputation: 335

Most likely? You ran into a weird bug or edge case in Windows. But there's nowhere near enough data in your question to guess why. – Bob – 2017-08-12T11:07:31.250

@Bob what other data should I provide? – t3chb0t – 2017-08-12T11:08:10.903

Mostly along the lines of actual memory usage (physical - RAMMap; virtual - Process Explorer or Task Manager, commit vs resident/private) while the issue occurs. And more description of the symptoms. Maybe the disk usage/free space, maybe a disk benchmark. But this kind of thing tends to be better suited to interactive troubleshooting (e.g. I'd go step by step based on relevance rather than requesting all of that info at once), and therefore not the best fit for Q&A in the first place. – Bob – 2017-08-12T11:24:36.427

3

My best guess is that your previous page file was highly fragmented and the new one isn't. When Windows manages your page file, it is extended piecemeal each time the swap requirement reaches the current size, a recipe for fragmentation. Your page file is quite small, so from time to time you should check the amount of swap used when the system is busy. You definitely don't want to run out of swap space.

– AFH – 2017-08-12T11:39:36.210

By the way, the normal recommendation for swap file size (twice the RAM size) should be ignored: it depends on the number and size of the programs you run, so that the less memory you have, the more swap space you need. – AFH – 2017-08-12T11:42:42.327

@AFH I've never used the Performance Monitor before but it seems to be a quite useful tool. I've checked the usage of the pagefile.sys and it's no more then 4% of its current size ~3GB (if I read the metrics correctly). This is everything very strange. It's also hard to believe that fragmentation could have anything to do with it as it mostly doesn't matter for SSDs and the performance before was really bad but I didn't notice any unusual Disk usage in the Task Manager. – t3chb0t – 2017-08-12T14:39:23.330

I've not investigated fragmentation on SSD, but several years ago I had bad performance problems on HDD, which turned out to be that the swap file had over 3000 fragments. Even on SSD, I would expect a performance penalty from all the look-ups to find fragment locations. I used SysInternals' Page Defrag, but that stopped working on recent Windows releases. Now the only way I have found to defragment a page file is to boot another OS and temporarily remove System status. – AFH – 2017-08-12T14:53:13.530

A similar thing can happen in Linux (but can be tuned via vm.swappiness). It would seem that having a smaller paging space has forced optimizations of the swapping algorythm making it more conservative about what pages it swaps out - which means less memory cache is available, but what is available is faster. – davidgo – 2017-08-12T20:11:14.240

@AFH the theory with the fragmented or damaged pagefile might be true... after reaching 70% of RAM applications started to crash (or rather Windows closed them) due to a warning that I'm running out of memory. Interestingly while the size of the pagefile was fixed Windows used 3-4% of it. I set it back to system managed and now Performance Monitor shows 0% used while the pagefile remains at the same size as I've set it before. There seems to be no logic behind it but is rather counterintuitive. – t3chb0t – 2017-08-13T14:16:50.763

@AFH now even with 80% RAM usage Windows still does not use the paging file and no longer shows any warnings... it looks like there is really some bug. There is however one difference now. I've set it to only partition C. Earlier Windows managed it for all drives. Maybe this was the reason for the poor performance. – t3chb0t – 2017-08-13T14:24:41.643

Windows issues the short of memory warning before increasing the page file size. I never let Windows manage my swap space, so I don't know if it extends to more than one drive. After some time programs will be swapped, and they won't return to memory until they become active, even when RAM is freed. You can check the size of pagefile.sys to see if your previously defined size is maintained, and you can check your other drive(s) to see if a page file has been created there. Without analysing your system in detail, I can't go much further in explaining what has been going on. – AFH – 2017-08-13T16:09:58.603

No answers