UXMPDFKit icon indicating copy to clipboard operation
UXMPDFKit copied to clipboard

Memory Leak Issue!

Open dipkasyap opened this issue 8 years ago • 5 comments

screen shot 2017-02-09 at 1 49 03 pm I found there is huge memory leak in this library, When i tried to profile the issue the almost all (78 percent of memory id used by library and the leak tool points to following line as suspect . please Have a look once. Hope will be in good condition soon, waiting for issue be closed .

let thumbRender = PDFSnapshotRenderer(snapshot: thumbnail)
       thumbRender.completionBlock = {
           self.rendersInProgress.removeValue(forKey: guid)
           DispatchQueue.main.async {
               self.progressBlock?(thumbRender.snapshot)
               completion?(thumbRender.snapshot)
           }

dipkasyap avatar Feb 09 '17 07:02 dipkasyap

Will look into it, thank you

pushchris avatar Feb 09 '17 14:02 pushchris

There's also the fact that Apple's CGPDF framework has a memory leak in its rendering (although the leak may be fixed, though it was there last time I looked in iOS 9.) It leaves unreleased CGPaths all over and they are only released when all pages and documents are released.

matt-curtis avatar Mar 12 '17 01:03 matt-curtis

Did you solve it ?

buildwithgagan avatar May 23 '17 12:05 buildwithgagan

@neoD1 can you provide me with some more details as to the document you are using? For example, how many pages are in your PDF, are you using forms, etc. Additionally could you check out the development branch and see if the issue still persists for you?

pushchris avatar May 25 '17 15:05 pushchris

Memory spikes when we use the highlighter tool / pen to draw . For example you use pen to draw on a page , then flip to next page and draw and so on for 4-5 pages . Ultimately it crashes . I have attached a sample PDF . 14800545773S78fIn4mOoKy1SwPAnDzdVfuvuKbg.pdf

buildwithgagan avatar May 26 '17 05:05 buildwithgagan