2

I have a custom UIDocument consisting of a file package with many small files (about 3200 text files). The overall size of the document is only ~600KB, but my app crashes each time I attempt to open the document due to low memory.

I tracked it down to the place where UIDocument tries to map the folder to an NSFileWrapper.

The document is displayed in a table, so at the most I would need to load only 20 files from the file package at once.

Is there a way to only "partially" load an NSFileWrapper or some other form of lazy loading (I'm not talking about memory mapping, since the problem is about many small files)?

Mark
  • 6,647
  • 1
  • 45
  • 88
  • Did you ever find a solution for this issue? – Epaga Jan 23 '15 at 15:23
  • 1
    See [this link](https://github.com/lukescott/LSFileWrapper). It looks like an attempt to resolve this exact issue...might be worth a try. – Dean Jan 23 '15 at 15:45
  • 1
    I did not find a solution for this issue. I changed my document design to use fewer files. – Mark Jan 28 '15 at 14:12
  • thanks @mark...it seems like this is what I will possibly need to do... – Epaga Jan 28 '15 at 18:55
  • If the fileWrapper has memory problem, what about only saving useful infomations (as string or other object) that will be shown in the tableView? – Steven Jiang Jan 30 '15 at 05:46
  • 1
    It seems caused by holding many FileWrapper object at one time, what about change to holding the obj as other type, and using FileWrapper only in file edit operations? – Steven Jiang Jan 30 '15 at 05:53

0 Answers0