WSL2 has a configuration file .wslconfig, which can contain settings for it. Most of the settings don’t ever need to be touched with maybe one exception: memory. By default it’s 50% of total memory on Windows or 8GB, whichever is less, so with effective max of 8 GB unless you set it manually. It’s a reasonable default, though you might encounter it if you are doing something memory intensive.

Excerpt from configuration of WSL2

Link to documentation