Does Windows Subsystem for Linux consume resources (CPU/memory/HD) when I don't use it?

In WSL, memory and CPU are only used when you run linux applications.


Memory used by WSL

If you are not running a Linux program, the WSL does not use any memory or starts any process.

  • The first time you start a linux window, one or more init processes are started. In my Windows 10 with Ubuntu 18.04, it occupies 0.1MB in RAM and, typically, 0% of CPU.
  • The console starts multiple processes: some console windows processes, a WSL background host, an some linux launchers. In my test, all these processes occupy 13.3MB in RAM.
  • Each time you run a linux program, it will occupy the corresponding memory and CPU percentage.
  • After you close all the consoles and linux processes, all these processes are killed.

Disk space used by WSL

Note that the disk space occupied by the WSL may vary depending on the Linux distributions you install in your computer. Currently, it is possible to install multiple distributions: e.g., Ubuntu 14, Ubuntu 18, Opensuse and Kali Linux. In fact, you can create your own distributions.

When you install a Linux distribution from the Windows app store, a linux launcher is installed. The first time you run the program, it downloads a compressed file with the distribution and unpacks that file.

  • The disk space occupied by WSL depends on the linux distribution you are used.
  • Usually, the compressed file is not deleted. Then, you must consider the size of the compressed file and of the distribution filesystems.

Considering the Ubuntu distributions that you can get from Microsoft.

  • Ubuntu 14: the 14.04.5.3-server-cloudimg-amd64-root.tar.gz compressed file occupies 182MB. After decompression, it is 255MB approx.
  • Ubuntu 16: the 16.04.2-server-cloudimg-amd64-root.tar.gz file occupies 226MB. It is 672MB approx after decompression.

You may check other distributions compressed files from the LxRunOffline wiki.


I have no problem with the other answers, "linux distro app not running, no resources being used", however if you run a persistent process within the WSL linux distro app the process will continue even when the linux app is closed. eg I have WSL ubuntu 18.04 running on W10 x64 pro 1903. I have installed full lamp stack, eg apache2, mysql etc, running wordpress and drupal websites using WSL ubuntu. sudo service apache2 start runs the service and it will continue to run even if the wsl ubuntu app is closed. So to answer the original question "WSL linux distro app can continue to run processes and consume resources even when the app is closed"


The memory is used up by the Linux's file cache. You can check with the buff/cache section of the free command. To drop the cache and thus free up the RAM, do echo 3 | sudo tee /proc/sys/vm/drop_caches.

If you find doing this too often, you can limit the memory used by WSL by setting

[wsl2]
memory=512MB

in %userprofile%/.wslconfig.