7 ms·
If you thought electron apps used a lot of memory, this thing will surprise you [0]: With WSL2, apps will now use either 50% or 8GB of your available memory.
by siproprio 5y ago
If you thought electron apps used a lot of memory, this thing will surprise you [0]:
With WSL2, apps will now use either 50% or 8GB of your available memory.
Happy coding!
[0]: https://github.com/microsoft/WSL/issues/4166 https://github.com/microsoft/WSL/issues/4166
- siproprio 5y agoAlso, looking forward for that new gvim 8GB memory footprint new feature!
- gfiorav 5y agoAre you sure? I watched the conference and this uses the RDP framework behind the scenes, integrating with Wayland. Why would it consume much more than running natively?
- NicoJuicy 5y agoIt's not exactly wsl is it? Linux considers free memory useless and uses it as cache. https://www.linuxatemyram.com/ https://www.linuxatemyram.com/ Weird that i didn't knew this. Couple of years ago i wasted some time to get more "free" memory on my server. Lol
- Dylan16807 5y agoExcept that the cache needs to be intelligently shared or split between operating systems, and it's not. Or at least not well, as of 20H2.
- Ajedi32 5y agoThat's not really an issue under normal usage; unused memory _is_ useless. The problem is that in this case Linux has to share memory with another OS.
- whywhywhywhy 5y agoMaybe it's what it's doing for me but I run it for days at a time and it's only taking 2GB.
- deleted 5y ago[deleted]
- donkarma 5y agowsl2 is such a downgrade from wsl1
- kuroguro 5y ago+1 If I wanted a VM, I would run a VM. Looks like this is WSL2 only :/
- bitwize 5y agoIf you want a GUI in WSL1, VcXsrv still works.
- dxxvi 5y agoIt's not perfect: I run IntelliJ in Arch WSL1 and 1) it crashes every time it opens a .md file athough I have (LIBGL_ALWAYS_INDIRECT=1). I have to put -Dsun.java2d.opengl=false -Dsun.java2d.d3d=false in idea64.vmoptions and disable the markdown plugin (maybe only 1 of them is enough) 2) In Windows, IntelliJ automatically saves files when it loses focus. I have to remember to Ctrl-S all the times with IntelliJ in WSL1 3) IntelliJ can't detect where there's a change in the file system. I have to Reload All from Disk all the times.
- xbar 5y agoFirst I've heard this. I've used neither. What is the major harm of WSL2?
- josalhor 5y agoAt least for me, WSL1 had pretty good performance on the Windows file system. On WSL2 accessing the Windows file system is pretty slow. You can read about it here: https://github.com/microsoft/WSL/issues/4197 https://github.com/microsoft/WSL/issues/4197
- TingPing 5y agoBut compute in general performs better and all non-windows io is way faster.
- 2ion 5y agoPS C:\Users\2ion> cat .\.wslconfig [wsl2] memory=6G processors=4 These settings are being respected, as far as I can tell. Since when is it not common sense to assign a reasonable amount to a VM? The only thing that does not seem to work well at the moment is a "memory balloon" RAM allocation scheme. WSL2 is a VM, not a shared memory container. They could do better, but RAM is pretty cheap nowadays and WSLg is IMO the much more productive feature. See https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig https://docs.microsoft.com/en-us/windows/wsl/wsl-config#conf....
- HideousKojima 5y agoA single (idle) SQL Server Docker container shouldn't be using 5 GB of ram
- piaste 5y agoSQL Server by design grabs as much RAM as it can, as aggressively and preemptively as it can, because it assumes it's the most important process running on the machine. Which is almost always the case in production environments, and a reasonable default behaviour as a result. If that's not the case, you can easily set resource limits at the application, container, and/or VM level. (This comment coming from someone who used to have to support running small backup MSSQL instances on Windows 8 tablets.)
- skeletonjelly 5y agoYep this. SQL Server using RAM is by design. If it's using too much because you're using it for dev work then you can simply limit the amount it can access. RAM is there to be used!
- MereInterest 5y agoIt's a perfectly fine design so long as there's one, and only one, program that is maximizing its RAM usage. When you have many programs (e.g. the browser, Teams, slack, every single electron app), then you get loads of contention.
- ROARosen 5y agoDid you try setting a RAM limit in .wslconfig ? https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig https://docs.microsoft.com/en-us/windows/wsl/wsl-config#conf...
- HideousKojima 5y agoThat's been going on for a few months already, I have a single Docker image running in WSL2 running SQL Server and it's using 5 GB of memory while idle.
- segmondy 5y agoI'm curious why the parent comment doesn't have an upvote or downvote button.
- sangnoir 5y agoIt was probably in a cool-off period. HN has a bunch of anti-flamewar features that temporarily discourage voting under specific circumstances.
- 1_player 5y agoPS C:\Users\1_player> cat .\.wslconfig [wsl2] memory=32GB Eh, who cares.
- lunfard00 5y agoMaybe unrelated but I think it is a Hyper-v (w10) issue, not a WSL one. At least same thing happened to me some days ago on one VM running on Hyper-v, it went crazy and consume all my 32gb of ram. It seems to be fixed after reducing the number of cores available to it.
- dleslie 5y agoAt least the WSL apps share resources.