I am using Docker to run some containers on Windows 10, and when I was done I noticed an application named vmmem was using almost all of my ram: ~12GB. According to this it is because of Docker and it said if I closed all docker images and containers it would stop. So I stopped and removed all Docker containers and images by the following batch file:
@echo off
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i
Run Code Online (Sandbox Code Playgroud)
from: https://gist.github.com/daredude/045910c5a715c02a3d06362830d045b6
so when you type docker container ls -a & docker image ls -a they both show nothing. However in Task Manager I still see vmmem using about 4 GB of RAM. What else can I do to stop this? Thanks.
Col*_*ode 76
创建一个%UserProfile%\.wslconfig文件,并添加以下配置:
[wsl2]
memory=6GB # How much memory to assign to the WSL2 VM.
processors=5 # How many processors to assign to the WSL2 VM.
Run Code Online (Sandbox Code Playgroud)
注意:默认情况下,内存为 Windows 上总内存的 50% 或 8GB(以较小者为准),处理器为可用总数。
然后通过在 PowerShell 中运行以下命令(以管理员身份运行)重新启动 WSL2:
Restart-Service LxssManager
Run Code Online (Sandbox Code Playgroud)
来源: https: //learn.microsoft.com/windows/wsl/release-notes#build-18945和https://learn.microsoft.com/windows/wsl/wsl-config#configuration-setting-for-wslconfig
小智 27
查看 WSL 上所有正在运行的发行版
wsl -l -v
Run Code Online (Sandbox Code Playgroud)
终止正在使用的
wsl -t {insert distro}
Run Code Online (Sandbox Code Playgroud)
更多信息请参见 https://blog.simonpeterdebbarma.com/2020-04-memory-and-wsl/
aje*_*eet 15
关闭 Vmmem 并避免重新启动计算机的最简单方法是,以管理员身份在 CMD 或 PowerShell 中运行以下命令:
taskkill /F /IM wslservice.exe
Run Code Online (Sandbox Code Playgroud)
我发现关闭 Vmmem 的最简单和最简单的方法是进入 Windows powershell 并输入:cmd wsl --shutdown. 这将关闭它。
| 归档时间: |
|
| 查看次数: |
7871 次 |
| 最近记录: |