How do you see the specific methods responsible for allocating memory in Xcode Instruments?

I was asked to try to reduce memory usage in the application code that was provided to me. The application works fine in the simulator, but on the device it is completed or something else, when debugging, it goes into the "paused" state, and the application closes on the device.

When I started the tools, I found leaks, fixed them, however, a large amount of selection occurs. In a few seconds of launch, the tool distribution trace shows 1.021K for "Malloc 16 Bytes". This, in fact, is useless information, as it is, I need to see where the memory is allocated, but I can not find anything useful. All I can get for deeper verification is that "dyld", "libsystem_c.dylib", "libCGFreetype.A.dylib", etc. They allocate a lot, but the responsible caller is never a recognizable method from the application source.

How can I find out which methods cause most distributions here? I need to disable this use! thank you

+4
source share
2 answers

Opening an extended detailed view will display a call stack for memory allocation. Choose View> Advanced Part to open an advanced detailed view.

Switching to the tree view of calls will help you find where you allocate memory in your code. Use the navigation bar to go to the call tree.

+4
source

1MB doesn't really matter. You cannot do much in terms of full viewing without using 1 MB.

There is a good video from WWDC 2010 (http://developer.apple.com/videos/wwdc/2010/) that covers the use of tools for analyzing memory usage. Header - Advanced memory analysis using tools. May be updated video from 2011.

0
source

Source: https://habr.com/ru/post/1385070/


All Articles