Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

How Much Memory and Disk Space Do Linux Containers Use in WSL?

There’s no universal RAM or disk figure for a Linux container in WSL. Measure Docker object storage and WSL filesystem use separately, and don’t confuse configured limits with actual consumption.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no fixed amount of RAM or disk space that a Linux container uses in WSL. It depends on the image, running processes, workload, files changed inside the container, mounted volumes, and any limits you configure. To get a useful answer for your setup, measure Docker’s object usage and the WSL filesystem separately—and distinguish both from WSL’s overall memory and virtual-disk limits.

Why there is no standard per-container number

WSL 2 runs Linux distributions in a shared Linux virtual machine. With Docker Desktop’s WSL backend, Docker’s engine and container data use a Docker-managed WSL area. A container’s resource use is therefore not the same thing as the total memory shown for the WSL VM or all the disk space assigned to a WSL virtual disk.

The footprint varies with the container’s image and writable changes, its processes and workload, and whether data is stored in mounted volumes. Docker’s official documentation does not give a representative RAM or disk benchmark for a typical Linux container in WSL, so a universal “usual” figure would be misleading.

Memory: WSL VM settings are not container limits

Microsoft documents the WSL 2 memory setting in %UserProfile%.wslconfig as a VM-wide setting. Its documented default is 50% of total Windows memory. The swap default is 25% of Windows memory, rounded up to the nearest GB; swap is disk-backed memory, not RAM. These are defaults for WSL configuration, not measurements of what a container consumes or recommendations for every workload. See Microsoft’s WSL configuration documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sandisk 2TB Extreme Portable SSD, Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware, External Solid State Drive, SDSSDE61-2T00-G25
  • Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
  • Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
  • Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
  • Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
  • Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C

Docker’s --memory option sets a hard memory maximum for an individual container, enforced through Linux cgroups when supported by the kernel and runtime. Docker says containers have no resource constraints by default. For example, start a container with a 1 GiB maximum by adding --memory=1g to its docker run command. That sets a ceiling; it does not mean the container will use 1 GiB. See Docker’s resource-constraints guide and the docker run reference.

To assess current use, observe the running workload with Docker’s live resource reporting or Linux process and memory tools in the relevant environment. Treat the result as a reading from that machine and workload, not as a general WSL figure. If Windows still shows memory in use after an image build, some of it may be cached WSL memory rather than active container demand.

Rank #2
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
  • Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
  • Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
  • Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
  • Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
  • From Sandisk, a brand professional photographers trust to take on assignments.

Disk: distinguish Docker data, filesystem use and virtual capacity

Inspect Docker’s images, containers and volumes

For Docker daemon storage, run docker system df; add -v for detailed image, container and local-volume accounting. The detailed output distinguishes image size shared with other images from unique size. Do not add image totals as if every image layer were stored separately: layers can be shared. The command reports Docker objects, not every file on the Windows drive. See the docker system df reference.

Check the WSL filesystem’s actual free space

Microsoft documents this command for checking a WSL 2 distribution’s filesystem:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

wsl.exe --system -d <distribution-name> df -h /mnt/wslg/distro

If that command is unavailable, Microsoft suggests wsl df -h /. The df output shows filesystem size, used space, available space and percentage used. Use it to check the filesystem you care about; looking inside one user distribution does not necessarily show all Docker Desktop backend storage. See Microsoft’s WSL disk-space guide.

Do not mistake a virtual-disk maximum for current use

Microsoft says WSL 2 virtual hard disks expand as storage needs grow and documents a default maximum capacity of 1 TB for each VHD. The related defaultVhdSize setting controls the maximum for a WSL 2 distribution VHD. That maximum is not the amount a fresh installation immediately occupies on the Windows drive. A full VHD can still cause out-of-space errors, so check actual free space rather than relying on the theoretical maximum.

Rank #4
Sale
Sandisk 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model
  • NEARLY 2X FASTER THAN OUR PREVIOUS GENERATION(8) – move 1,000 high-res photos in under 60 seconds(6) with up to 2000MB/s transfer speeds(2).
  • IP65 RATING AND UP TO 3M DROP PROTECTION(3) – protects against spills and drops.
  • POCKET-SIZED – fits easily in pockets and small bags.
  • SPACE TO OWN YOUR AI CONTENT – speed and capacity to download your high-res clips and photo edits.
  • 256-BIT AES ENCRYPTION(4) – helps keep private files secure with password protection.

Find Docker Desktop’s storage location

Docker Desktop’s WSL 2 backend stores its engine data by default under %LOCALAPPDATA%Dockerwsl. Docker Desktop settings also expose a disk-usage limit and disk-image location. The configured limit, the VHD’s capacity, and the space currently occupied are different measurements. See Docker Desktop’s WSL 2 backend documentation and Docker Desktop settings.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Measure first, then tune or clean up

  • For RAM: check the WSL-wide memory and swap settings, then observe the running container workload. Use Docker’s --memory option only when you need a per-container hard ceiling.
  • For disk: use docker system df -v to inspect Docker objects and df -h in the relevant WSL filesystem to see capacity and available space. These commands answer different questions.
  • Before deleting: identify which Docker images, stopped containers or volumes are reclaimable and whether your work still needs them. Docker’s accounting helps you inspect usage before cleanup.

Microsoft’s WSL container tutorial notes that “Images and stopped containers consume disk space” and shows wslc container prune for stopped containers and wslc image prune for unused images. Those commands are for Microsoft’s WSL container CLI, not Docker. Microsoft’s current overview says that CLI requires WSL 2.9.3 or later; see the WSL container overview and the WSL containers tutorial. Docker users should inspect and manage Docker data with Docker’s own CLI.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Memory reclamation and WSL configuration

Microsoft lists autoMemoryReclaim as an experimental setting in .wslconfig. Its documented values are disabled, gradual (slowly reclaim cached memory automatically) and dropCache (reclaim cached memory immediately); the documentation lists dropCache as the default. Docker recommends enabling this setting to help Windows reclaim unused WSL memory after container image builds. Reclaiming cache can return memory to Windows, but it does not lower the actual memory demand of an active workload. Because this is an experimental, version-sensitive setting, check the current Microsoft configuration documentation for the syntax and behavior applicable to your WSL version.

.wslconfig applies globally to WSL 2; /etc/wsl.conf configures an individual distribution. Microsoft says configuration changes take effect after WSL stops and restarts. To stop all running distributions before restarting, run wsl --shutdown. Docker’s guidance on reclaiming memory is in its WSL backend documentation.

Quick Recap

Bestseller No. 2
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
From Sandisk, a brand professional photographers trust to take on assignments.
$188.90
SaleBestseller No. 3
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.99
SaleBestseller No. 4
Sandisk 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model
Sandisk 1TB Extreme Portable SSD, Up to 2000MB/s Transfer Speeds-New Model
IP65 RATING AND UP TO 3M DROP PROTECTION(3) – protects against spills and drops.; POCKET-SIZED – fits easily in pockets and small bags.
$259.29
SaleBestseller No. 5
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$188.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.