If you have way more memory than AE says it needs, sometimes you just need to relaunch AE. I used to get that every now and then.
If you’re really running out of memory, as indicated by your OS (Task Manager or Activity Monitor), then you should render to a still sequence (to preserve rendered frames) and use the Secret prefs to purge during Make Movie. To do that, hold down shift when accessing prefs>general, and keep the key down until the last dialog box appears. Then choose “secret” at the bottom of the prefs list.
Once your still sequence is done, re-import and render to a Quicktime or whatever. That’ll be fast.
Will that help?