Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do the colors and percentages mean in the Leaks Instrument?

I am debugging (looking for memory leaks) using Xcode for my small application. I use Leaks from Instruments. If there is a leak, I can click on a method name and I see source with marked place where the leak is. It is ok. However I have two questions about the source view:

  1. What does the color of a marked line mean? Some lines are light violet, some lines are dark violet.

  2. What are the percentage values in a line with memory leak? What does 10%, 80%, 100% mean?

like image 248
MDW Avatar asked Nov 26 '10 07:11

MDW


1 Answers

From the Instruments user guide.

Regarding your question no. 1:

The Detail pane (while it is in Table mode) displays other useful information to help you spot potential allocation issues. The net versus overall allocations column of the table shows a histogram of the currently active objects and the total number that were ever created. As the ratio of net allocations to overall allocations shrinks, the color of the histogrambar changes. Blue histogrambars represent a reasonable ratio while colors shifted towards the red spectrum represent lower ratios that might warrant some investigation

Regarding your question no. 2:

The Leaks instrument examines a process’s heap for leaked memory. You can use this instrument together with the Allocations instrument to get memory address histories. This instrument requires that you launch a single process so that it can gather data from the start of the process. This instrument captures the following information:

  • The number of leaks
  • The size of each leak
  • Address of the leaked block
  • Type of the leaked object

Each view mode in the Detail pane shows the leak data in a slightly different way. In table mode, this instrument shows the individual leaks along with the percentage that each individual leak contributes to the total amount of leaked memory discovered. In outline mode, the data is reorganized so that you can see how much memory is leaked from within a given symbol. For entries in eith

like image 176
materialvision Avatar answered Sep 22 '22 07:09

materialvision