I would like to know what the difference between "Leaks" and "Allocations > # Living" shown in Instruments.app of Xcode 5 is. I used iprofiler
command to check the memory leaks of my C++ command line application built with Clang++, and opened a .dtps
file with Instrunents.app.
$ iprofiler -leaks ./a.out
$ open a.dtps
As you can see in the attached screen shot, there is a large living memory of 166.61 MB. Apple explains that "# Living" is "The number of allocations created during the selected time range and still existing at the end of it." It sounds like that "# Living" indicates the amount of memory leaks.
But I do not see this "leak" in the "Leaks" tab in the application window. What is the difference between "Leaks" and "# Living"?
Allocated and still living objects are those, that are still used by the app and a reference is hold onto. Using this number you may identify objects that you are still holding onto and thus use up memory. The allocation analysis helps you to improve memory usage issues. They are not leaked thug, but still referenced.
Leaks are objects in your app that are no longer referenced and reachable. So objects, that never were freed or dealloc`ed respectively.