2

For some reason my iOS app (written in Swift 3) "documents and data" size continually gets larger and larger every time I run it.

I've noticed that every time I "reload data" the documents and data size increases by ~5mb, however my "reload data" process does not involve core data at all, and consists of calling a few REST APIs (through URLSession.shared.dataTask(with: baseURL)) followed by storing the parsed JSON response values in a collection within a single object.

Each time new data comes in, I simply overwrite the data that was previously in the collection, I do not write anything to a file, I do not interact with core data at all.

Any ideas on what could possibly be the source of the issue? Or what can cause "documents and data" to increase in size aside from core data?

Chris Schlitt
  • 411
  • 4
  • 17
  • do you use `NSKeyedArchiver/NSCoding` or the preferences to write large amounts of data to? or write out plists or something? – Fonix Jan 18 '17 at 02:42
  • No I don't use those. Is there a way to monitor what is read/written from core data? – Chris Schlitt Jan 18 '17 at 03:07
  • 1
    You can open the simulator documents folder in finder and see what is in there and what is taking up all of the space. see http://stackoverflow.com/questions/25198840/document-directory-path-of-ios-8-beta-simulator – Josh Homann Jan 18 '17 at 03:17
  • Thanks! It looks like there is a lot of data in the fsCachedData folder. I'll have to look up what that is – Chris Schlitt Jan 18 '17 at 03:54
  • It was my URL response cache that was causing the issue. Which makes sense. I'll have to either clear it regularly or set a limit – Chris Schlitt Jan 18 '17 at 04:03
  • @ChrisSchlitt same thing is happening with me...how did you fix it? – jayant rawat Feb 27 '20 at 09:38

0 Answers0