Search code examples
iosiphone-6iphone-6-plus

ridiculously high storage usage in iPhone 6+


I'm working (helping out) on an iOS app. On most devices the app's stabilized storage use is within 60-80MB. The same app (and same revision) on the iPhone 6+ starts using Gigabytes of data within minutes ... to the point of filling up the storage and I can't even run the app from XCode anymore. I've only been able to get it on the iPhone 6 once, but it's a regular occurrence on the 6+. I've also tried on a range of other devices from 5th gen iPod touch to the iPhone 5 and no other device goes over the 80MB.

The only portion of code that uses a significant amount of storage is the image caching, which caches the (static) images downloaded from the server keyed on the image id. Then again this code is (or seems to be) working fine on other devices. It is also a portion of the codebase that hasn't changed in a while.

Can anyone think of a reason why this issue is only seen on the iPhone6+ (and to a much lower extent the iPhone6)?


Solution

  • The problem was that malloc stack logging was enabled and not set to compact. It logged every single allocation made by the app and it was the log file that grew so large.

    As to why it only occured on the iPhone6 and iPhone6+, I still don't have an answer.

    The problematic file was stack-logs.773.1006c8000.REDACTED.wmQj2k.index. It grew to 700MB almost right after login.

    Much thanks to @jrturton because his answer really lead to this.