Your system has run out of application memory
"To avoid problems with your computer quit any application you are not using". Not sure to have had this problem before MacOs Mojave. But now I got this message several times during composing the annual review of my family diary.
My iMac's memory is 16 GB and has 474 GB free space on HD, much enough for swap area. FotoMagico5 Pro 5.6.4 is using 1,33 GB (shown in activity app).