Closed chyt closed 9 years ago
I've been trying to do more debugging on my own but I'm really not getting any information. I tried to look at a call tree to see where all the memory was being allocated but all I get are a bunch of memory addresses, which I don't know how to interpret.
Any help would be greatly appreciated.
Hi. I'm not really familiar with operationQueues, but the first thing that comes to mind when I look at your code is what happens at the end of the operation? How is the operation being released? Because it is holding your images, and that would be a good candidate for increased memory. How are the operations being release?
Thanks for the help, the issue was indeed with NSOperationQueue and I was able to resolve it. Marking this as closed.
I'm using Tesseract to do text recognition from screenshots, but I'm running into an issue with huge memory usage. For example, recognition on just 6 images puts memory usage at over 200MB. Also, the memory is not getting deallocated after the recognition is complete.
My process is that the user imports screenshots, then I crop each screenshot into 6 smaller images. Then I run each of those images through Tesseract using an NSOperationQueue, similar to what is done in the sample project. I've identified that my Tesseract method is the source of the issue (commenting it out results in memory use of only ~30MB.
Here is the code for in the method:
Here is a screenshot of the results from the allocation profiler:
Please let me know if you need any further information. Thank you for the help.