-
1. Re: AVConversionConvertFromPDFWithHandler for jpeg memory leak?
lrosenth Oct 12, 2010 1:10 PM (in response to andrejusc)If you make the call twice in the row, does the memory grow that much each time? I suspect not.
The first time you invoke it, it has to initialize itself and load all the necessary things into memory - but it's a one time thing.
-
2. Re: AVConversionConvertFromPDFWithHandler for jpeg memory leak?
andrejusc Oct 12, 2010 1:23 PM (in response to lrosenth)Memory grows each time with that call. Look at this:
2010.10.13 00:13:51:109 pid: 6352, tid: 6596: Memory before AVConversionConvertFromPDFWithHandler: 1035579392
2010.10.13 00:13:56:468 pid: 6352, tid: 6596: Memory after AVConversionConvertFromPDFWithHandler: 1025404928
2010.10.13 00:14:45:968 pid: 6352, tid: 6596: Memory before AVConversionConvertFromPDFWithHandler: 990334976
2010.10.13 00:14:51:515 pid: 6352, tid: 6596: Memory after AVConversionConvertFromPDFWithHandler: 988655616
2010.10.13 00:15:45:374 pid: 6352, tid: 6596: Memory before AVConversionConvertFromPDFWithHandler: 966565888
2010.10.13 00:15:49:812 pid: 6352, tid: 6596: Memory after AVConversionConvertFromPDFWithHandler: 964751360
2010.10.13 00:16:48:421 pid: 6352, tid: 6596: Memory before AVConversionConvertFromPDFWithHandler: 941375488
2010.10.13 00:16:53:062 pid: 6352, tid: 6596: Memory after AVConversionConvertFromPDFWithHandler: 939618304
Well, while it doesn't grow each time by 10 MB as with initial call, it still grows by about 2 MB on each call after that.
So, if called in that way for let say 101 PDFs - then I'll loose about 210 MB of memory and if I want to process even more files without Acrobat restart - probably it will crash at some point.
-
3. Re: AVConversionConvertFromPDFWithHandler for jpeg memory leak?
lrosenth Oct 12, 2010 1:34 PM (in response to andrejusc)Check that you are properly closing & releasing all the objects you are using...
-
4. Re: AVConversionConvertFromPDFWithHandler for jpeg memory leak?
andrejusc Oct 12, 2010 1:43 PM (in response to lrosenth)Yes, I do all those AVCommand/ASCab objects (which are usually involved in such conversion) destroy on each iteration in form like this:
ASCabDestroy(settings);
ASCabDestroy(config);
ASCabDetachPointer(inputs, kAVCommandKeyPDDoc, PDDoc, NULL);
ASCabDestroy(inputs);
AVCommandDestroy(cmd);
if (pdDoc) PDDocClose(pdDoc);
if (jpegDstFile) ASFileSysReleasePath(ASGetDefaultFileSys(), jpegDstFile);So, I can't think about anything else, which could still consume memory by 2MB chunks on each call


