TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Taking Back Memory from Vmmem/WSL

1 点作者 spdebbarma将近 5 年前

1 comment

spdebbarma将近 5 年前
How to reclaim RAM from Vmmem when you&#x27;re not using Windows Subsystem on Linux)WSL.<p><i></i>TL;DR<i></i> Takeaway<p>WSL does use a really low amount of RAM but it is allocated about 4GB by default when it is started. If you think that’s too much and would like to decrease it, Windows Insider Build 18945 brough customizable settings for wsl.<p>Create a %UserProfile%\.wslconfig file and use it to limit memory assigned to WSL2 VM.<p>```<p>[wsl2] kernel=&lt;path&gt; # An absolute Windows path to a custom Linux kernel.<p>memory=&lt;size&gt; # How much memory to assign to the WSL2 VM.<p>processors=&lt;number&gt; # How many processors to assign to the WSL2 VM.<p>swap=&lt;size&gt; # How much swap space to add to the WSL2 VM. 0 for no swap file.<p>swapFile=&lt;path&gt; # An absolute Windows path to the swap vhd.<p>localhostForwarding=&lt;bool&gt; # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true).<p># &lt;path&gt; entries must be absolute Windows paths with escaped backslashes, for example C:\\Users\\Ben\\kernel # &lt;size&gt; entries must be size followed by unit, for example 8GB or 512MB<p>```<p>Therefore, in your situation, all you need to include in your file is ⤵<p>`<p>[wsl2] memory=1GB<p>`<p>Customize it as necessary with the available options.