I don't think you have enough ram for today's image, unless you cut some things. Maybe try in site.conf.:
BB_NUMBER_THREADS = "4"
PARALLEL_MAKE = "-j 4"
Granted it will take about double time to build like this, but cutting back might make it easier on the build machine.
I have ancient computer for image building. It's just a little better equipped with dual cores and about 64GB ram. 16GB of ram may not be quite enough anymore. Seems 16GB was the minimum standard for image building years ago? Shown below is a screencap of top, and then another window inside showing the image build in progress. The computer ram is being drained with only two processes. Qtwebengine and Kodi is all that is running in the build. All other tasks on the computer are idling.
Screenshot from 2023-05-06 19-40-41.jpg