That problem can be caused by your "Undo History" getting too large. You can set your preferences to track fewer "undos." You can also manually delete the "undo history" every so often.
My son had the same problem with his orchestral templates, and he uses Miroslav and East-West. In his case, he could only let the undo history grow until three "undos" before Logic (he was using 8 at the time) would get quirky. I came across the issue way back at 5.51 for PC. Seems to me the memory error message is not as specific as it could be: i.e., "Arrrgh! Delete your undo history to proceed..."
From Logic's main menu, select "Options --> Project Info" to see how much memory your undo steps are using. If there is no usage, it should say 24.
To reduce the number of undo steps the system tracks, select "preferences --> general --> editing" from Logic's main menu.
Juan, John, Jean, Jack, Howie, Bert or Mongo. Take your pick.
There is a good list of Tips for Optimizing the Mac for ProTools on Avid's site. Your can find it under their support section.
Logic's "Project Info" can help you monitor which segments of your workflow are grabbing memory.
In reading other posts, I see people trying stuff (multiple simultaneous audio apps, for example) that I wouldn't dare attempt. I have seen too many obscure "blue screen" messages from PCs, and I dread the Mac's spinning rainbow cartwheel of doom.
In my experience with Logic, if working on more than a couple of songs over the course of a day, you should take a few minutes and restart your system.
Like you mentioned, over time caches get fill, and the Mac OS isn't actually the best for clearing things out... for example, Take a session, close, open another close, and then quit Logic. If you look at system memory in Activity monitor, you will see a large blue or yellow section in the pie graph. That is data the OX thinks you might need.
I use an app: I free mem. It can restore allot system memory, but it is not always the best way. Restarting your system is.
I suggest to all my tech clients to work this way (every 2 cues, restart) and while you spend the extra time doing this, in the end their system runs better, they have less crashes, and loose way less time and frustration to crashes.