iOS is pretty smart about how often it flushes to disk. I have noticed that when I background the app, as long as I call msync
, i.e. msync(self.memoryMap, self.memoryMapLength, MS_SYNC);
it flushes properly.
While I use the app, even if there is a crash or sudden termination, usually all data is saved. If I kill my app while debugging, sometimes the last few changes are not saved, but usually everything is saved.
So my conclusion is that this is not a concern. iOS is not constantly writing to disk, it is writing to disk at smart intervals.