Error: not enough memory

So I am working on a little project and about half a minute into running it i get error: not enough memory. What does this mean and how can I fix it?

It means your iPad doesn’t have enough space to store the data of your code. You know how if you try and render enough stuff it gets laggy and your frame rate drops? It’s basically what happens when you go beyond lag. To fix it, I think you have to find some more efficient way to do what you want to do, and free up some memory. Try deleting things in your multitasking bar (drag up with four fingers, hold down on the icons and delete them. Don’t worry, it doesn’t remove it from your iPad, it just basically clears all the information the app was using while you were using it), too. All the apps you were using are still running, you know!

It may mean you have an endless loop because of a bug.

Or Codea isn’t releasing unused memory fast enough. You can use this command

collectgarbage()

to force it to do it more often

I would use print statements or parameters to show you what is happening. This command

gcinfo()

will tell you how much memory you are using