iPhone - improving disk bottleneck
<p>I am designing this app and there's a section where the users are allowed to draw with their fingers. As I provide a undo for the operation, when the user starts drawing I have to quickly grab the current drawing content and store it somewhere.</p>

<p>I first tried to store the undo as a CGLayer and also as an image, but my app memory usage went up from 7 to 19 Mb. With 19 MB I am relatively safe, because 24 Mb appears to be the theoretical limit beyond things start to be dangerous. The problem is that I have another section of my app that requires lots of memory and if I run this, the memory peaks from 19 to 28 Mb, that is too dangerous to risk.</p>

<p>Then I decided to save the image on disk. To prevent the little gap that happens when the image has to be saved when the user fires TouchesBegan I refined, to the limits of sanity, the saving to disk method and now I barely don't feel any gap. I said, I barely don't feel, but I still feel a little hair gap, I would say &lt;0.1s that takes to the line start drawing.</p>

<p>What I do is to fire a queue operation to manage the file saving.  </p>

<p>Is there any other ways you guys can envision on how could this be improved?</p>

<p>thanks</p>
