在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:tapwork/HeapInspector-for-iOS开源软件地址:https://github.com/tapwork/HeapInspector-for-iOS开源编程语言:Objective-C 72.2%开源软件介绍:HeapInspectorFind memory issues & leaks in your iOS appHeapInspector is a debug tool that monitors the memory heap with backtrace recording in your iOS app. You can discover memory leaks, no longer used objects, abandoned memory and more issues directly on your device without ever starting Instruments. Memory heap snapshots with backtrace recordBasically you can inspect the entire heap and see all living objects of your iOS app.
HeapInspector gives you detailed information for the living objects:
In ActionWhySince ARC has been introduced we don't need to manage the
And that's why we introduced HeapInspector to find those issues. InstallationCocoaPodsHeapInspector runs with Objective-C and Swift via CocoaPods
Just add the HeapInspector to your
and run CarthageYou can use Carthage. Specify in Cartfile: github "tapwork/HeapInspector-for-iOS" ManualDownload the repository into your project via git or just as zip.
Drag it the Disable ARC for How to use itMake sure to import the header file @import HeapInspector; Swift import HeapInspector StartJust run the following to start HeapInspector in a separated debug window. The window can be moved on your screen in order to reach all your UI elements. The left circle button starts / stops the memory heap snapshot. See demo above. [HINSPDebug start]; Swift HINSPDebug.start() We recommend to use a specific class prefixes, Swift modules or even a real classes like [HINSPDebug addClassPrefixesToRecord:@[@"RM", @"UITableView"]; Swift You can register modules for the heap snapshot and recordings. HINSPDebug.addSwiftModulesToRecord(["MyModule", "AnotherFrameworkModule"]) StopStopping and removing the inspector's window goes with [HINSPDebug stop]; Swift HINSPDebug.stop() Just call the start/stop methods at app launch or via your custom button. Backtrace recordHeapInspector can also record the backtrace for each object that received an alloc, retain, release or dealloc.
Use this only with very specific recorded classes or in smaller apps.
Start the backtrace with [HINSPDebug recordBacktraces:YES]; Swift HINSPDebug.recordBacktraces(true) Example projectHeapInspector comes with an example project. There you will see a lot of mistakes made with the memory design.
References, Inspirations & Thanks
AuthorLicense |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论