Recently I had a problem with my virtual server. I allocated 16gb of RAM but windows used only 11gb. 5gb was reserved for hardware ?!
So I started to find out what could be the problem. And here is a solution.
Open msconfig
In windows search type msconfig and open it

Go to Boot tab and click Advanced option

Here you have on top right option to alocate max RAM. I had to disable this option (I also disabled Number of proccesors option)

After reboot my virtual server shoved all 16gb of RAM!!
I have checked this 2 options on my PC (windows 11) and it is working better that unchecked. So I guess this is different when using virtual server.