WSL2 Memory Sizing - Increasing or decreasing the memory available to WSL2

preview_player
Показать описание
The Windows Subsystem for Linux operates as a virtual machine that can dynamically grow the amount of RAM to a maximum set at startup time. Microsoft sets a default maximum RAM available to 50% of the physical memory and a swap-space that is 1/4 of the maximum WSL RAM. You can scale those numbers up or down to allocate more or less RAM to the Linux instance.

Рекомендации по теме
Комментарии
Автор

thank you for the video! I recently bought a new machine and decided for Windows 11 with Ubuntu WSL - I thought already it was the wrong decision and I should have ordered the machine with a Linux Setup. You saved my day!

patrickwalchshofer
Автор

Naive question: I have 32 GB RAM. I am running a Python code that requires 30 GB of memory. So I made a .wslconfig file that uses 24 GB of memory and 8 GB of swap. In the future, there is no certainty that I will not need more memory to run a different code. Can I increase the swap space to 64 GB and assume that WSL can use my SSD space as a swap, like in Linux?

koushiksen
Автор

How would i set my hard disk as the home directory will i be using the same steps .wslconfig

martelljohnson
Автор

Which is the windows home directory? Because c:\Users\myname does not work for me

lean.rp_
Автор

I dont understand.. is the memory in wslconfig file 50% (default) of hardware memory or RAM>

peacebeuponhimever