From be3fd1379bcc17c5251126f3352f78cacaaf13b3 Mon Sep 17 00:00:00 2001 From: "Marios K. Pappas" <66968346+Pri3st@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:59:17 +0300 Subject: [PATCH 1/3] Update faq.rst Added a workaround for WSL 2 consuming high amounts of RAM, leading to reduced performance of the host machine. --- source/getting-started/faq.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/getting-started/faq.rst b/source/getting-started/faq.rst index 6582cec..80a8b12 100644 --- a/source/getting-started/faq.rst +++ b/source/getting-started/faq.rst @@ -102,4 +102,15 @@ How to retrieve your desktop login details ? The container's root password can be obtained with ``exegol info `` (i.e. this is needed when using the :doc:`desktop ` feature) -.. TODO: add a note, when the Desktop feature is in prod, that explains the ups and dows of X11 vs. Desktop mode. \ No newline at end of file +WSL 2 consumes massive amounts of RAM and CPU power. How can I deal with this issue ? +============================================ + +Users might experience excessive memory consumption when using Exegol. This is caused by WSL 2 not freeing up RAM even when processes are finished, causing large amounts of unused memory to remain allocated. This leads to high memory usage on the host system and reduced performance. More information about this issue can be found [at this GitHub issue](https://github.com/microsoft/WSL/issues/4166). A simple workaround is to create a `%UserProfile%\.wslconfig` file in Windows and use it to limit memory assigned to WSL 2 VM. + +``` +[wsl2] +memory=8GB # Limits VM memory in WSL 2 up to 3GB +processors=2 # Makes the WSL 2 VM use two virtual processors +``` + +.. TODO: add a note, when the Desktop feature is in prod, that explains the ups and dows of X11 vs. Desktop mode. From 277daa0e8f846c7cc77c6922f159f527b5ff351c Mon Sep 17 00:00:00 2001 From: "Marios K. Pappas" <66968346+Pri3st@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:27:33 +0300 Subject: [PATCH 2/3] Update faq.rst len(title) fixed - equal number of `=` --- source/getting-started/faq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/getting-started/faq.rst b/source/getting-started/faq.rst index 80a8b12..5e40e33 100644 --- a/source/getting-started/faq.rst +++ b/source/getting-started/faq.rst @@ -103,7 +103,7 @@ How to retrieve your desktop login details ? The container's root password can be obtained with ``exegol info `` (i.e. this is needed when using the :doc:`desktop ` feature) WSL 2 consumes massive amounts of RAM and CPU power. How can I deal with this issue ? -============================================ +==================================================================================== Users might experience excessive memory consumption when using Exegol. This is caused by WSL 2 not freeing up RAM even when processes are finished, causing large amounts of unused memory to remain allocated. This leads to high memory usage on the host system and reduced performance. More information about this issue can be found [at this GitHub issue](https://github.com/microsoft/WSL/issues/4166). A simple workaround is to create a `%UserProfile%\.wslconfig` file in Windows and use it to limit memory assigned to WSL 2 VM. From a352b4d6b4bf8998cc3c9d11dd353b47d24ed60f Mon Sep 17 00:00:00 2001 From: "Marios K. Pappas" <66968346+Pri3st@users.noreply.github.com> Date: Tue, 29 Oct 2024 18:24:50 +0200 Subject: [PATCH 3/3] Update faq.rst Added instructions on how to limit excessive disk consumption from Docker with WSL2 as the backbone. --- source/getting-started/faq.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/getting-started/faq.rst b/source/getting-started/faq.rst index 5e40e33..0e6faad 100644 --- a/source/getting-started/faq.rst +++ b/source/getting-started/faq.rst @@ -102,8 +102,8 @@ How to retrieve your desktop login details ? The container's root password can be obtained with ``exegol info `` (i.e. this is needed when using the :doc:`desktop ` feature) -WSL 2 consumes massive amounts of RAM and CPU power. How can I deal with this issue ? -==================================================================================== +WSL 2 consumes massive amounts of RAM, CPU power, and Disk Space. How can I deal with this issue ? +================================================================================================== Users might experience excessive memory consumption when using Exegol. This is caused by WSL 2 not freeing up RAM even when processes are finished, causing large amounts of unused memory to remain allocated. This leads to high memory usage on the host system and reduced performance. More information about this issue can be found [at this GitHub issue](https://github.com/microsoft/WSL/issues/4166). A simple workaround is to create a `%UserProfile%\.wslconfig` file in Windows and use it to limit memory assigned to WSL 2 VM. @@ -113,4 +113,13 @@ memory=8GB # Limits VM memory in WSL 2 up to 3GB processors=2 # Makes the WSL 2 VM use two virtual processors ``` +When using Docker with the WSL2 backend, resource limits are managed by Windows. There might be cases, for example after updating an Exegol image, where Docker might take double the disk space the image needs. To deal with this problem, users should find the `Disk image location` in Docker Desktop (`Settings -> Resources -> Advanced`). It will be in the following format `C:\Users\\AppData\Local\Docker\wsl`. The Virtual Hard Disk can be located in the following path, `C:\Users\\AppData\Local\Docker\wsl\disk`. Users can use the `diskpart` tool to shrink the Virtual Hard Disk using the following instructions based on directions [here](https://stackoverflow.com/questions/70946140/docker-desktop-wsl-ext4-vhdx-too-large). +- Stop Docker Desktop +- Start an administrative CMD or PowerShell session +- Stop WSL2: `wsl --shutdown` +- Start the diskpart tool: `diskpart` +- Select the Virtual Hard Disk: `select vdisk file="C:\Users\\AppData\Local\Docker\wsl\disk\docker_data.vhdx"`. A message `DiskPart successfully selected the virtual disk file.` should appear. +- Shrink the Virtual Hard Disk: `compact vdisk` +- Wait for the proccess to reach 100 completion (might take some time) + .. TODO: add a note, when the Desktop feature is in prod, that explains the ups and dows of X11 vs. Desktop mode.