How to stop iOS running out of memory when at max zoom level on CATiledLayer?
<p>I have a CATiledLayer inside a UIScrollView. When I pinch to zoom in as far as possible the memory occupied by "other processes" momentarily becomes very high. Sometimes it is enough for jetsam to kill my app and sometimes my iPad will spontaneously reboot.</p>

<p>The large amount of memory deallocates when I release my fingers. It copes if I zoom in only very slowly. The worst scenario is when I put two fingers on the screen and move them steadily apart at a moderate speed.</p>

<p>Comparison at rest, and during pinch:</p>

<p><a href="https://i.stack.imgur.com/KKZ9F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KKZ9F.png" alt="Standard"></a><a href="https://i.stack.imgur.com/EywCm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EywCm.png" alt="During pinch"></a></p>

<p>For context, I am rendering PDF content and it works fine apart from this issue. Normally I use 4 levels of detail and 1024x1024 tiles.</p>

<p>I can still reproduce the problem consistently using all default values on CATiledLayer for tile size, detail and bias. I have also tried not rendering any content into the tiles (just filling them white) and the problem occurs the same way.</p>

<p>Does anyone know how to prevent this "other processes" memory building up so much?</p>