среда, 4 января 2012 г.

MemCheck for iOS v 2.0 in english

Memory leaks are frequent problem in iOS projects. I have developed a lib which catches leaked objects and visualizes their relationships between each other.

All interactions occur through a Xcode console. Press pause in a Xcode debugger and input something like that:  

po [parser run:@"leaks saveGraph /Users/yourName/Documents/dot/mem.txt"]

The command generate mem.txt file for a dot tool (http://www.graphviz.org/). A dot must be installed. Then we can convert mem.txt to dot file by:

dot -Tdot mem.txt -o mem.dot && open ./mem.dot 

That will show graph with live and died objects from your application at current moment. Some examples:



An arrow from the DetailViewController to the UILabel means that an object of DetailViewController contains an object of UILabel. A dotted arrow shows when an object dead. Live objects have a white background, dead objects have a gray background.

About a parser command format and special filter (fromList) which remove all unnecessary objects you can read on memCheck-for-iOS git hub page.

Happy Using :)

Комментариев нет:

Отправить комментарий