4 ms·
PS 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 com
by 2ion 5y ago
PS 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.
- easton 5y ago> (This comment coming from someone who used to have to support running small backup MSSQL instances on Windows 8 tablets.) Can I ask what the use case was? Was it just in case the primary DB server died and they wanted a battery powered backup?
- ryanjshaw 5y agoCan't speak for OP but here in Africa I've worked on a two unrelated projects where poor internet connectivity meant it made sense to have a local SQL Express running on a users device, which a service would then try to regularly synchronize with the central server. Makes sense when you are capturing documentation and can make all the decisions in disconnected operation.
- voxic11 5y agoWSL2 runs in a vm which is integrated with windows, so it actually dynamically requests memory from windows as required. It also can release memory back to windows and is basically is represented on the windows side as a windows process. Unfortunately like a process there is no way for windows to request memory back from linux (besides killing the entire thing). So its up to the linux kernel to decide what to release back. What that configuration does is limit the maximum amount of memory it can request (what the linux kernel sees as the total system memory). The reason you need to set a limit right now is that the linux kernel will pretty quickly request most of your windows memory to use as page cache if you don't limit it. Microsoft is working to allow the linux kernel to use the windows page cache instead of maintaining a separate one. https://github.com/microsoft/WSL/issues/4166#issuecomment-641445502 https://github.com/microsoft/WSL/issues/4166#issuecomment-64...
- siproprio 5y ago> Microsoft is working to integrate the linux disk cache with the windows disk cache to avoid this issue ... since july 2019, a locked discussion, a lot of dupes, and no progress to report thus far.
- 2ion 5y agoIt sounds like a very complicated topic, it's crossing multiple isolation boundaries, and pretty risky to implement, too. A bug can be maximally critical.
- account42 5y ago> Unfortunately like a process there is no way for windows to request memory back from linux (besides killing the entire thing). I have long thought it would make sense to add a way for the OS to ask processes to relinquish memory that they can do without. A lot of processes have memory that they use for caching which can safely be dropped but doing so when the memory is not needed elsewhere unnecessarily limits performance.
- psd1 5y ago