I often get that error if I've got a big household. The way I manage it is to watch the memory use of the game using Windows Resource Monitor that is accessed from the performance tab of Task Manager.
I find I can usually save 2 or 3 times before I get Error 12. I do save often so I don't loose too much if I get an error. I tend to get the error mostly when I think I'll just do a little bit more before I save and then I get it and wish I'd learned my lesson by now and just save, shut down the game and reload if I've already saved a few times since the last reload.