Sorry about the poor experience. Which version of After Effects are you currently working on? Are you only having this issue with this project? Do you have any third-party plugins installed? When you experience the looping problem again, Could you go to Edit > Preferences > Memory & Performance > Show Memory Usage Details and share a screenshot of the window? Also, please share your system specifications (OS, CPU, GPU, RAM).