Hi @anonymous_user_07ba972c,
I had similar problems I fixed them here
Visual Studio 2022 Preview is 64 bit Compile Lighting locally
You can use this on any UE5 source version as well.
You may need to add a 64GB pagefile.sys, which I documented in
Install a bigger pagefile.sys
using 5GB is quite normal . I have once used 12GB during project conversion