I have a strange issue where I’m scrolling through a paged UIScrollView which displays the pages of a PDF document (using Quartz 2D and CATiledLayer). When I page through memory allocation looks fine with it going up with a few initial pages and then keeping it steady as it obviously releases the memory kept for earlier pages. Upon hitting page x (not a certain PDF page or a certain number per se) memory usage goes from a couple of megs to 308 megs and the app crashes.
So my question is: how to best try to find what’s causing this? The object alloc tool in instruments shows the memory as simply going to malloc. (in huge chunks).
This is an old question but I’ve since figured out the problem so why not post it…
Turns out the culprit was a certain kind of embedded (vector) artwork inside the PDF. This would happen on several different print PDF-s. CGPDF et al just went nuts. The only workaround was to actually rasterize said artwork with the appropriate PDF production tools.