UIImage memory

Does reloading new images into a UIImage view increase the memory usage each time a new image is loaded, thus potentially leading to a memory leak? If so, then do I need to release the memory used for the currently loaded image before reloading the UIImage with a new image?

Replies

Some parts of your code may be calling the funcionalities of iOS or other frameworks. If your call is done in a bad manner, that may cause memory leaks in somewhere you did not write.


So, if you continue developing apps, how to solve such leaks is one thing you need to learn. Also you need to know that not all such leaks may be solved.

It looks like the "leaks" instrument output provides the stack trace of where the memory leak occurred. If this is true and I do not see any of my functions displayed in the stack trace then I do not know how to progress the issue. I do not even know where other code exists which was not originally written by myself.

It is true that if your code is not included in the stack trace, it is very hard to find what may be causing the leak.


But, assuming a vanilla project does not show any leaks,

something you have added to the project may be causing the leak.


I do not insist on taking infinite time to solve all the leaks, but ignoring them so easily does not seem to be a good habit.

Thanks for your input. I will google around to find some information and see how it goes.