win + R
输入%UserProfile% 并运行进入用户文件夹

新建文件夹.wslconfigmemory根据自己电脑配置设置


[wsl2]
memory=10GB
swap=0
localhostForwarding=true

关闭当前子系统 cmd中运行
wsl --shutdown

资源占用过高解决办法|4-12_电脑配置