{"id":1609,"date":"2021-05-09T16:39:45","date_gmt":"2021-05-09T23:39:45","guid":{"rendered":"http:\/\/blog.nillsf.com\/?p=1609"},"modified":"2021-05-09T16:41:03","modified_gmt":"2021-05-09T23:41:03","slug":"reduce-windows-subsystem-for-linux-2-memory-usage","status":"publish","type":"post","link":"https:\/\/blog.nillsf.com\/index.php\/2021\/05\/09\/reduce-windows-subsystem-for-linux-2-memory-usage\/","title":{"rendered":"Reduce Windows Subsystem For Linux 2 memory usage"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I recently bought a new desktop, and one of the first things I did was install a ton of games! After that, I wanted to get some work done and installed WSL 2. As on my laptop, the memory usage can be pretty high.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To optimize the memory usage of WSL2, you can use the following configuration file: <code>%UserProfile%.wslconfig<\/code> and enter the following content (feel free to edit the memory setting. I set it to 2 GB):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;wsl2]\nmemory=2G<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then restart the WSL service using the following command in an elevated PowerShell window:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Service LxssManager | Restart-Service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And you should see that the memory usage is drastically reduced:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"133\" src=\"\/wp-content\/uploads\/2021\/05\/image-4.png\" alt=\"\" class=\"wp-image-1610\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2021\/05\/image-4.png 886w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2021\/05\/image-4-300x45.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2021\/05\/image-4-768x115.png 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And that&#8217;s how you can reduce the memory consumption of WSL 2. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently bought a new desktop, and one of the first things I did was install a ton of games! After that, I wanted to get some work done and installed WSL 2. As on my laptop, the memory usage can be pretty high. To optimize the memory usage of WSL2, you can use the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1611,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,41],"tags":[181,42,82,129],"class_list":["post-1609","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source","category-windows","tag-linux","tag-windows","tag-wsl","tag-wsl2"],"jetpack_featured_media_url":"https:\/\/nillsfblog.blob.core.windows.net\/media\/2021\/05\/2021-05-09-16_35_08-Customize-core-dumps-in-Azure-Kubernetes.pptx-Microsoft-PowerPoint-Online-and-.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/1609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/comments?post=1609"}],"version-history":[{"count":1,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/1609\/revisions"}],"predecessor-version":[{"id":1612,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/1609\/revisions\/1612"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/media\/1611"}],"wp:attachment":[{"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/media?parent=1609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/categories?post=1609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nillsf.com\/index.php\/wp-json\/wp\/v2\/tags?post=1609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}