I built a plone 6 (volto 17.13.0) site using the Create a Project docs. The backend builds fine but when I make build in the frontend end the 4GB AWS Lightsail instance runs out of memory when it gets to Compiling server default build.... I ran make clean and then make build again but got the same result.
I also tried using the node option --max-old-space-size=3500 but then the it simply fails when it get to that limit.
If you build container images, also check the max memory available to the docker engine on the system. I had this set to 2Gb on a server and then the dockerfile building can also run out of memory. Esp. On the yarn build.