Hi and Welcome. My Name is ***** ***** I look forward to assisting you today with your question.
Go to Apple menu > About This Mac and click Storage. How much Storage is left there ?
You have enough space on the drive. So you are running out RAM.
We can try some basic troubleshooting steps and see if it works or not.
First reset the PRAM and NVRAM of your Mac. Follow the steps below to reset the PRAM and NVRAM
Shut down your Mac
Restart and immediately hold down Command,Option,P and R keys at the same time
Hold the keys down until the computer restarts and you hear the startup sound for two or three times.
Release the keys and let the Mac boot up.
If that didn't work,then restart your Mac and immediately hold down Shift key on your keyboard for 15 seconds and this will boot into Safe Mode. Does it work in safe mode ?
Please let me know if that didn't work, so we can continue troubleshooting.
Now restart normally and see if you are getting the error