Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

3 Gotchas with WSL 2 around Disk Space, Memory Usage and Performance

3-gotchas-with-wsl-2-around-disk-space-memory-usage-and-performance.jpg

In this video, we'll identify and go over how to fix 3 different WSL 2 issues that'll likely cause you trouble over time.

Quick Jump:

As of July 2020, it’s easy to get in a situation where WSL 2 will eat up all of your disk space, use 80% of your memory and get poor file I/O performance when accessing mounted drives.

We’ll go over how to address all of these issues below. Everything we’ll go over will work for all editions of Windows 10.

Update: I also recorded a 2nd video that focuses on reclaiming a ton of disk space from Docker Desktop’s WSL 2 VM. I recommend watching that video after this one.

# Going Over Everything

Timestamps

  • 0:30 – Combating poor file performance in WSL 2 when accessing mounted drives
  • 2:38 – Ensuring WSL 2 doesn’t use up to 80% of your system’s memory
  • 6:17 – Clearing out WSL 2’s memory usage on demand with a Bash alias
  • 8:21 – Reclaiming disk space that WSL 2’s VM won’t free up by default
  • 10:12 – Be careful because WSL 2 won’t auto-mount your external drives
  • 12:56 – How to shrink your WSL 2 VM to reclaim disk space in PowerShell
  • 18:10 – An alternative to the Optimize-VHD command on Windows 10 Home
  • 19:10 – Recap and hopefully Microsoft fixes these issues in future WSL 2 patches

Reference Links

Are you aware of any other gotchas with WSL 2? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per year (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments