Windows 10 and Windows 11
Control Panel▸System and Security▸System▸Advanced system settings▸Advanced▸Performance▸Settings…▸Advanced▸Virtual memory▸Change…
Either check Automatically manage paging file size for all drives, or increase the Custom size value, or check System managed size.