Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS App storage (documents and data) keep increasing #330

Open
chn-lee-yumi opened this issue Jun 15, 2024 · 4 comments
Open

iOS App storage (documents and data) keep increasing #330

chn-lee-yumi opened this issue Jun 15, 2024 · 4 comments

Comments

@chn-lee-yumi
Copy link

Each time when I recompile my project and run it on my iPhone, the "documents and data" part of the APP will increase, and the size of the app seems to increase by the same size as the CoreML model. This space won't release even when I uninstall the APP. After a few times, the "documents and data" of my APP now use more than 15GB. I don't know how to release this space and my iPhone storage is full too.

I found a similar issue here: https://developer.apple.com/forums/thread/751805

@chn-lee-yumi
Copy link
Author

I found that it would decrease after a few days. But there's no way to manually clean it. Reboot won't clean it.

@ZachNagengast
Copy link
Contributor

Check your temp directory, this could be the system cache of the mlmodel that gets created during specialization.

@sahmed53
Copy link

sahmed53 commented Jul 3, 2024

@ZachNagengast i am noticing the same thing, used the app a few times and the app size in "documents and data" is over 10gb, keeps increase each time i boot up the app -> the increments are equivalent to the model size. I have downloaded the container from Xcode using "windows" menu - > "Devices and simulators" to inspect the caches and temp files, and they only contain files a few mb in size. I have tried to programmatically clear the temp directory and the caches, but doesn't seem to change the value in the "documents and data". Any thoughts?

@sahmed53
Copy link

sahmed53 commented Jul 4, 2024

@ZachNagengast @chn-lee-yumi - After some further digging around, this appears to be an issue with using ANE.

  1. Setting the configuration.computeUnits = .cpuAndGPU (i.e. turning off ANE) does NOT cause an increase in app size - very little is written to disk during loading of the model
  2. Setting the configuration.computeUnits = .cpuAndNeuralEngine (i.e. using ANE) increases the app size each time the app is loaded - increments by the size of the model, and this can be seen in xcode as being written to disk specifically the ANE weights of the model are being written to disk.

This behaviour appears to occur in other apps that use ANE - https://developer.apple.com/forums/thread/751805.

There is a clearly an issue with using Apple neural engines, this looks like a big, and whilst it doesnt impede the functioning of the app, and the "documents and data" size does not correspond the to real app size, it will probably make a user delete the app if they see a false size of 10gb.

Any help for a fix would be appreciated since clearing caches, temp folders etc etc does not reduce the app size in "documents and data"

Let me know if you need any further info/help in debugging the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants