Windows swap file restriction

Aleh

New Member
Local time
1:06 PM
Posts
1
Thread starter
I'm working on the laptop with with Windows 10 onboard and only 16GB RAM without opportunity of extending this amount of RAM. By the working needs I'm using Rider + Webstorm + SQL Server Windows NT 64 Bit + Microsoft SQL Server Management Studio + Chrome. All these occupies almost all RAM of the laptop (90-95%). If I need to open any other program or search anything in Chrome I'm facing the lack of memory and Windows moves some programs to the swap-file. Almost every time one of this program is SQL Server Windows NT 64 Bit and any work with the DB becomes extremely slow (disregarding I'm using SSD NVMEv2).

I'm not asking about tweaking MY programs. I'm asking how to restrict Windows 10 from moving to the swap file a list of programs (at least just my SQL Server which occupies nearly to 300 MB)? I'm OK if it makes some other processes even system work not so well.
 
Windows Version
10

My Computer

System One

  • Operating System
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    Xiaomi
    CPU
    Intel(R) Core(TM) i7-8550U
    Memory
    16 GB
    Hard Drives
    SAMSUNG MZVLW256HEHP-00000
    Samsung SSD 960 EVO 1TB

Digerati

Active Member
Member
Local time
4:06 AM
Posts
75
Location
Nebraska, USA
and only 16GB RAM
Why do you say "only" 16GB? 16GB of RAM is a huge amount of RAM. 8GB is plenty for most people. With only 4GB, then "only" might be appropriate.

If you restrict Windows from using the Page File, all you are going to do is creating a worse bottleneck.

What you need to do is to make sure you have lots of free disk space on your boot drive - hopefully the fast SSD Then just let Windows manage your Page File on that SSD.

And it is important to understand, despite what some seem to incorrectly believe, the folks at Microsoft really are experts at memory management. I've been working with page and swap files and Windows since before Windows and I know I am not. Are you? If not, then again, let Windows manage the PF. It knows how to optimize and manage it very well.

And don't forget, the purpose of the page file is for the OS to put "soon to be needed", but lower priority data in that page file. If you manually limit the PF size, or try to force other files into the PF, you end up forcing Windows to keep lower priorty data in System RAM. Not good! In fact, that is bad as it then forces Windows to save important data back to normal (read: slow) disk space, instead of the ready PF.
 

My Computer

System One

  • Operating System
    W10 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    BrightWorks Systems BWS-6
    CPU
    Intel Core i5-6600
    Motherboard
    Gigabyte GA Z170-HD3
    Memory
    32Gb (4 x 8Gb) Corsair Vengeance DDR4-3000
    Graphics Card(s)
    EVGA GeForce GTX 1050Ti
    Sound Card
    Integrated
    Monitor(s) Displays
    Samsung S24E650BW x 2
    Hard Drives
    Samsung 850 Pro 256GB SSD
    Samsung 860 Evo 500GB SSD
    PSU
    EVGA SuperNova G2 550W Gold
    Case
    Fractal Design Define R4
    Cooling
    CM Hyper 212 EVO, 2 x 140mm FD case fans
    Keyboard
    Microsoft Wireless Comfort Desktop 5050
    Mouse
    Logitech M190
    Internet Speed
    >150Mbps
    Browser
    Edge
    Antivirus
    Microsoft Defender, Malwarebytes Premium

Berton

New Member
VIP
Local time
3:06 AM
Posts
44
Location
Wyoming USA
To add a historical note, back in the '90s the written recommendation in Help and Support for Virtual Memory suggested 2.5 times the physical RAM for the paging file/swapfile, later versions went with1.5 times the RAM. Both settings also suggested a larger amount for memory-intensive programs. I haven't needed to change lately but for older machines I would set the page file to Off, reboot and defrag the drive then set the Max and Min to the same number, kept all parts of the file contiguous to each other and improved drive access, didn't have to search for the parts of the file. With SSD drives it shouldn't be as great a problem, no moving parts like in an HDD.
 

My Computer

System One

  • Operating System
    Windows 10 Pro

iko22

Active Member
Member
VIP
Local time
10:06 AM
Posts
170
Location
South West England
Why do you say "only" 16GB? 16GB of RAM is a huge amount of RAM. 8GB is plenty for most people. With only 4GB, then "only" might be appropriate.
The OP stated:

I'm using Rider + Webstorm + SQL Server Windows NT 64 Bit + Microsoft SQL Server Management Studio + Chrome. All these occupies almost all RAM of the laptop (90-95%).
 

My Computer

System One

  • Operating System
    Windows 10

iko22

Active Member
Member
VIP
Local time
10:06 AM
Posts
170
Location
South West England
I'm not asking about tweaking MY programs. I'm asking how to restrict Windows 10 from moving to the swap file a list of programs (at least just my SQL Server which occupies nearly to 300 MB)? I'm OK if it makes some other processes even system work not so well.
Maybe Lock Pages in Memory is the solution to your question:

Lock Pages in Memory is a Group Policy feature, therefore it would only be available for Windows 10 Pro computers.

Lock pages in memory

This security setting determines which accounts can use a process to keep data in physical memory, which prevents the system from paging the data to virtual memory on disk. Exercising this privilege could significantly affect system performance by decreasing the amount of available random access memory (RAM).

Default: None.


Hope that helps .
 

My Computer

System One

  • Operating System
    Windows 10

Digerati

Active Member
Member
Local time
4:06 AM
Posts
75
Location
Nebraska, USA
The OP stated:
That explains what he is doing - it does not rationalize changing the PF, or file restrictions. The solution is to add more RAM, or free up RAM, not force things to stay in RAM.

That said, assuming we are talking about Jetbrains Rider, the minimum system requirements is 4GB, which suggests 8GB would be more than sufficient and 16GB would be gobs - even with Webstorm.

Unless one is a true computer scientist with advanced expertise in Windows memory management, stop pretending to be one and leave the PF settings alone! The only thing users need to do is to make sure there is plenty of RAM installed and lots of free disk space on the boot drive. Forget the nonsense about 1.5 x RAM. That always was just an arbitrary number someone decided made a good "rule of thumb". That might have been fine way back in the day when 256MB of RAM was considered a lot, but not today. With 16GB installed, that would suggest setting the PF to 24GB. A ridiculous amount.

Contrary to what some want us to believe, there are true CompSci professionals at Microsoft who not only have decades of experience to draw on, they have exabytes of empirical data and supercomputers to crunch scenarios. And there is a reason, the PF in W10 is "dynamic" and that is because it is NOT a "set and forget" setting.

Windows 10 is not XP. It is time to stop treating it like it is XP.

@Aleh - the only real advice (besides leaving things alone) I can give you is to either look into using a different browser, or you regularly exit Chrome when not actively browsing, or at least regularly restart Chrome - since it is notorious for hogging and not giving up resources. You should also look at what else is starting with Windows and disable everything you don't immediately use each session. Do not disable your security, however. And if using 3rd party security, consider something else. Again, contrary to what many want us to believe, Defender is actually quite capable.

I would also suggest you open Resource Monitor from the Performance tab in Task Manager and see what programs are actually eating up your RAM.

If you have already culled the programs that automatically start with Windows, and/or you exit programs when done using them and still are running out of RAM, you really only have one true solution. If your notebook does not support adding more RAM, you need a new notebook that does.
 

My Computer

System One

  • Operating System
    W10 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    BrightWorks Systems BWS-6
    CPU
    Intel Core i5-6600
    Motherboard
    Gigabyte GA Z170-HD3
    Memory
    32Gb (4 x 8Gb) Corsair Vengeance DDR4-3000
    Graphics Card(s)
    EVGA GeForce GTX 1050Ti
    Sound Card
    Integrated
    Monitor(s) Displays
    Samsung S24E650BW x 2
    Hard Drives
    Samsung 850 Pro 256GB SSD
    Samsung 860 Evo 500GB SSD
    PSU
    EVGA SuperNova G2 550W Gold
    Case
    Fractal Design Define R4
    Cooling
    CM Hyper 212 EVO, 2 x 140mm FD case fans
    Keyboard
    Microsoft Wireless Comfort Desktop 5050
    Mouse
    Logitech M190
    Internet Speed
    >150Mbps
    Browser
    Edge
    Antivirus
    Microsoft Defender, Malwarebytes Premium
Top