修改 WSL2的内存
WSL
Issues found on WSL
项目地址:https://gitcode.com/gh_mirrors/ws/WSL

·
WSL2默认可以使用的内存大小为主机的80%,对于Linux而言即使装了桌面,一般的开发也没必要给这么多内存,分多了,反而有可能卡主机的Windows
操作:
1.打开Windows资源管理器,地址栏输入 %UserProfile% 回车,在该目录下创建一个文件, 名字为 .wslconfig ,写入内容示例如下 (我电脑8GB内存,分给WSL内存2GB,另外设置交换分区4GB)
[wsl2]
memory=2GB
swap=4GB
localhostForwarding=true
1
2
3
4
cmd执行 wsl --shutdown 关闭WSL,再重新打开即可
https://blog.csdn.net/weixin_45579994/article/details/112386425




Issues found on WSL
最近提交(Master分支:5 个月前 )
8c61f09e
* Add super user detection; a powershell approach is used
* use the 'id' command
* avoid stderr warning & wsl alias 4 天前
ae780d11
4 天前
更多推荐
所有评论(0)