If you're running out of memory, the best thing to do is to export your graphics to a file and clear whatever variable stores them. If you want to use them again in the same session, you can import them back.