Configuring global settings with .wslconfig are only available for distributions running as WSL 2 in Windows Build 19041 and later. Keep in mind you may need to run wsl --shutdown to shut down the WSL 2 VM and then restart your WSL instance for these changes to take effect.
In the end the problem showed to be me creating .wslconfig with notepad and it automatic added .txt to the file name. At the same time I’m used to file explorer showing file extensions, but this is a new PC, so that was switched off, and I didn’t notice the problem.
I have now set the memory=22523412480 as suggested by mayay and it works - and it can even utilize CPU more than 100%