top | item 37823318

(no title)

skazazes | 2 years ago

Is this the reason Windows Task Manager seems to show Vmmem (WSL2) as gobbling up well more RAM then WSL seems to indicate is in use?

I have more then enough RAM on my office workstation to just accept this, but on my personal gaming computer that moonlights as a dev machine, I run into issues and have to kill WSL from time to time.

discuss

order

praash|2 years ago

That's just one part of the issue - even after forcefully dropping Linux's caches, WSL has been unable to reclaim the memory back reliably. There has been a recent update that claims to finally fix this.

You might find this package helpful: https://github.com/arkane-systems/wsl-drop-cache

Dylan16807|2 years ago

It's also really annoying that "drop caches" seems to be the only interface here. No way to simply limit it.

sp332|2 years ago

I think there is some conflict between the disk cache running inside WSL and the memory management outside. I tried turning up memory pressure in WSL but it didn't help. This does work but I have to run it manually from time to time:

  # sync; echo 3 > /proc/sys/vm/drop_caches

chabad360|2 years ago

No, that's because WSL (until v2/very recently) didn't properly release memory back to windows. This actually would cause docker to effectively leak memory really quickly.

Zetobal|2 years ago

The worst offense of wsl2 is writing files to ram before copying it to the native filesystem unusable with lots of data.