I have increased my .wslconfig file to allocate up to 12GB of RAM to the WSL2 VM, but it seems my containers are still hitting OOM exceptions when my processes utilize quite a bit of RAM. Exploring WSL, I see that docker-desktop still seems to be capping out at 1.1G of RAM consumption, and this number hardly varies despite the fact that VMMEM.exe is utilizing a considerable amount of memory and even changing which containers are running and running more containers does not seem to vary this number:
From within the containers themselves, I also see that the memory the container "perceives" itself utilizing also seem wrong but drastically different than WSL's perspective; i.e. running both top within the container and free -h still shows considerably different RAM even the 1.1G WSL reports.
The strangest part is that the free memory number in the container rarely changes no matter how programs are running within the container or how much memory these processes actually consume. The "Total memory available" usually reads the number I've allocated to WSL2 correctly, but the "free memory" seems to be locked at 4.3GB, even once processes clearly start expanding into that free allocation and eventually beyond it. They even begin hitting kernel OOM errors but that "4178.0MB free" number never changes.
TLDR; How can I get accurate look at my container's RAM usage using Docker Desktop 2 WSL2 backends, and how can I expand Docker Desktop to allow Docker containers to utilize the full memory space allocated to WSL2?
