In this project i using ARC
what is meaning of the red color and yellow and is it memory leak ?
The line of code highlighted red in your screenshot is red because a high percentage of the memory allocated in the method actCallTaxi: is allocated in the highlighted line, 94% of the allocated memory. If you find actCallTaxi: is allocating too much memory, Instruments is alerting you to the source of the high memory allocation by highlighting the line of code red.
The line of code highlighted yellow is yellow because a smaller percentage of memory allocated in actCallTaxi: is allocated in the yellow line. Instruments uses color coding to show the severity of possible problems in your code, with red being more severe than yellow.
The graph for the Leaks instrument isn't showing any leaks so you most likely don't have a problem with memory leaks.
Related
When i profile using system trace instrument. There is always three lines for every thread. So what does the red and blue line mean?
System calls are the red capsules, virtual memory faults appear as the blue capsules. The grey bar with the annotations "Blocked" and "Running" represents the thread state.
There's a WWDC session that explains https://developer.apple.com/videos/play/wwdc2016/411
I understand the Leaks tool takes a snapshot every X (default 10) seconds. But do the red bars in the Leaks graph tell me the amount of leaked memory at that snapshot in time? Or do they signify the cumulative memory leaked?
In other words, towards the end of this graph, has my app leaked the cumulative of all red bars in memory, or has it leaked no memory because the bar has diminished in size, and then didn't appear at all in the last snapshot interval?
You can check for yourself by clicking on the timeline and dragging over the time where the red bar is. A tooltip will open that tells you the number of leaks and the amount of leaked memory.
You'll find Instruments shows the cumulative total of leaks and leaked memory in the tooltip. In your screenshot, if you drag over the small red bar, the tooltip will report a higher number of leaks and leaked memory than it reports for the two taller bars in the graph.
I have been tested my app with instruments allocations and get this picture:
Like graphic shows, my app work normally, but is it normally value in overall bytes? And I'm worry about "#Allocations (Net/Overall)", because it's color is red.What is it mean (red color)
Red is the total (Overall) allocations made and deallocated during all your App's runtime.
Purple (really thin bar over the red one) are the allocated and not yet deallocated objects.
I would say that you don't need to worry too much about it, specially for internal objects or Malloc, and focus indeed on higher level objects such as views and controllers.
Also if you click on the Allocations tool's i you can choose to ignore CF (Core Foundation) or Malloc allocations, which I often do as you don't normally deal directly/don't have control over those allocations.
Again as you improve your higher level objects allocations you'll be indirectly improving those underlying allocations as well.
In my situation I continuously enter one scene, than exit and so on... So Live bytes amount must be the same while reentering the scene, but it grows up by 3Mb on each enter.
I want to find memory that remains from previous scene. Memory Leak instrument shows no leaks.
How can I compare two "snapshots" of memory to highlight differences in allocations?
Previous scene snapshot:
After reentering:
approach it using Heapshot Analysis
Here's a great blog entry by bbum: When is a Leak not a Leak? Using Heapshot Analysis to Find Undesirable Memory Growth
My app is a music player, it plays MP3's continuously from internet with AV Foundation. It has memory consumption issues.
When I look for the reason with Allocations or Leaks instruments, the Activity Monitor reports memory consumptions of 50MB or so.
When I run the app with Product->Run, the Activity Monitor reports memory consumptions of 20MB initially, and it increases 100kB per second. Why are they so different?
Further more, the Allocations or Leaks instruments all have the 'Allocations' row. The right side bars in Allocations gradually turn into red. The right side bars in Leaks are always blue. The 'Allocations' row works differently in these two instruments? I use Xcode 4.1.
To answer the question in the last paragraph, the Allocations instrument is configured differently for the Allocations and Leaks templates. In the Allocations template, the instrument tracks all memory allocations. In the Leaks template the instrument tracks only active allocations. The histogram (the colored bar on the right side) reflects the ratio of active to total allocations, with blue indicating a high ratio and red indicating a low ratio. Because the Leaks instrument tracks only active allocations, the active allocations equal the total allocations, giving you a blue histogram. Click the Info button next to the Allocations instrument to configure what it records.
If you want to see how much memory your application is using, look at the Live Bytes column for the All Allocations category in the Allocations instrument. Also, take a look at the following question:
Xcode Instruments output interpretation for iPad app