I’m running into an OutOfMemoryException while testing my app on a 27" retina iMac and while the error is triggered by maximizing my app’s main window canvas to full screen, I know it can render the image that size in other instances so I suspect the problem is due to a memory leak somewhere else due to poor coding on my part.
So 1) What’s the best way to track down a memory leak? and 2) Can anyone clarify whether the following scenario could be the culprit?
In a method I create a local method-only picture array and append new picture objects to that array. In the same method I store a reference some of those array picture objects in a global dictionary in the form dic.value(i) = pic array(i) etc.
When the method ends, will the picture array destruct completely or could the issue be that it doesn’t since the global dictionary is referencing some of the array objects? If so, would I have to clone the array picture objects and put the clones into the dictionary to resolve this?