My PC ram is 32Gb and its reaches to 20Gb is maximum when I tried that code, I will install Ubuntu then try it again to make sure it is not the hardware problem.
I just met that problem while changing from 2080Ti to 3090