Codea app memory problem

@Simeon Just wondering about the Codea app size. When I do Settings/General/iPad Storage on my iPad and look at Codea, I have a Documents and Data size of 733.2 MB. I have nothing in the Documents folder and about 12 things in the Dropbox folder using about 30 MB. I have about 795 projects and when I look at the Codea folder using the Files app and sort them by size, I have 1 project at 2.2MB, 6 projects in the 200KB size, and the rest about 30KB or less.

I deleted the Codea app on my iPhone and reloaded it. I then used my backup program to copy the 795 iPad projects and loaded them on the iPhone. Looking at the Documents and Data size on the iPhone, it’s 171.1 MB. I have just a few projects that have assets in their project folders which don’t get backed up or restored, and those account for just a few MB. So I’m just wondering where the about 560 MB difference is being used. I’m constantly creating/deleting projects as I try different thing and was wondering if iOS/Codea doesn’t reclaim memory the way it should.

Is there anything I can look at to see what’s different between what’s on my iPad and iPhone.

@Simeon I deleted Codea from my iPad Air 3. It was originally showing Documents and Data of 733.2 MB in Settings/General/iPad/Storage. I reloaded Codea, restored all my projects, synced my Dropbox folder, loaded the Music/Sound files, examples, etc, and did whatever else I thought was necessary to get me back to normal running condition. I ran the Settings/General/iPad/Storage to see what size Codea was now showing for Documents and Data. It’s now 13.8MB. That’s a drop of 719.4MB that I have no idea what was being used. I’m hoping that reloading Codea also solves my Dropbox syncing problem. Time will tell on that.

@dave1707 - whaaattt!!! Do you think all the edits and changes are still present? Or is it Codea not tidying up allocated memory and restoring it back to the expected limit?

Question - have you noticed any speed changes in operation - running projects and slick nature of the interface? (My iPad Codea seems very slow at the moment).

The prospect of cleaning out my system is a bit daunting. How did you approach it? Did you use one of your backup projects?

Edit: just checking on my iPad and not sure where to look.

Found:

App Size. 226.8 MB
Documents & Data 2.12 GB

In iPad storage under general settings.

@Bri_G I don’t know what was taking up all of that space. I do a lot of creating/deleting projects as I test things, so I thought maybe memory wasn’t being cleared properly. Also, whatever assets are in the documents or Dropbox folders will add to that value. Right now I don’t think that 13.8MB is correct since I have about 30MB in the Codea Dropbox folder. I did the same thing on my iPhone and that show a size of 171MB. Not sure what’s going on.

As for speed, I haven’t really noticed anything. But then I don’t have anything really big that might make a difference.

I used my backup program, but with the Codea changes to the asset files system several version ago, my program hangs and crashes Codea. I think the constant deleteProject and createProject is the problem. Codea isn’t doing them fast enough and my program just hangs and I have to close Codea which causes a crash. I had to run it about 15 or more times manually selecting about 20 or more projects at a time and checking what the last project was that got updated after each crash. It used to run in about 10 seconds, but now it takes awhile since Codea keeps crashing. I think the delete/create functions run separate from Codea so my code gets ahead and there’s a buildup of delete/create and things hang.

You’re really chewing up memory at 2.12GB. I wonder how much of that isn’t needed.

@dave1707 this is an interesting issue. Given that the memory being wasted was only reduced when deleting the app and re-adding your projects I suspect that Codea may be eating up space with random temporary files

These files get created for a few different reasons (possibly cached pdf images, zip files for exporting / importing, etc). We probably need to regularly clean these folders up on startup so that they don’t continuously grow from regular use

The OS doesn’t seem to distinguish these as a separate sort of file, nor clean them up automatically (unless space is running low, then I think it will do some spring cleaning for you)

@dave1707 - could the discrepancy you see after re-installing/syncing Dropbox be down to the sync only working to download when each project is run?

@John I’m not using a lot of memory on the iPad so iOS won’t clean up anything because space is running low. So the size of Codea just kept getting larger and larger.

@Bri_G ipad storage is still reporting Codea as 13.8MB which I think is wrong. I have about 35MB of files in the Codea Dropbox folder which I think should be showing. Plus I did the same thing on my iPhone (deleted Codea and reloaded everything) and that shows 171MB.