{"id":875,"url":"https://github.com/Tencent/MLeaksFinder","last_synced_at":"2025-07-30T19:32:53.109Z","repository":{"id":37664203,"uuid":"47960542","full_name":"Tencent/MLeaksFinder","owner":"Tencent","description":"Find memory leaks in your iOS app at develop time.","archived":false,"fork":false,"pushed_at":"2023-09-11T06:19:55.000Z","size":57,"stargazers_count":5426,"open_issues_count":72,"forks_count":935,"subscribers_count":107,"default_branch":"master","last_synced_at":"2024-11-28T10:04:57.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tencent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.TXT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-12-14T08:06:03.000Z","updated_at":"2024-11-28T06:23:07.000Z","dependencies_parsed_at":"2022-07-31T23:48:08.730Z","dependency_job_id":"19c30809-6afb-46c8-9e42-891944cb4718","html_url":"https://github.com/Tencent/MLeaksFinder","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2FMLeaksFinder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2FMLeaksFinder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2FMLeaksFinder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tencent%2FMLeaksFinder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tencent","download_url":"https://codeload.github.com/Tencent/MLeaksFinder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228178955,"owners_count":17881114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:15:33.564Z","updated_at":"2024-12-04T19:32:11.428Z","avatar_url":"https://github.com/Tencent.png","language":"Objective-C","funding_links":[],"categories":["Code Quality","awesome-ios ##","Objective-C","工具","HarmonyOS","Tools","OOM-Leaks-Crash"],"sub_categories":["Other free courses","Getting Started","Windows Manager","GraphQL"],"readme":"[中文介绍](http://wereadteam.github.io/2016/07/20/MLeaksFinder2/) | [FAQ中文](https://github.com/Zepo/MLeaksFinder/blob/master/FAQ-CN.md)\n\n# MLeaksFinder\nMLeaksFinder helps you find memory leaks in your iOS apps at develop time. It can automatically find leaks in UIView and UIViewController objects, present an alert with the leaked object in its View-ViewController stack when leaks happening. ~~More over, it can try to find a retain cycle for the leaked object using [FBRetainCycleDetector](https://github.com/facebook/FBRetainCycleDetector/tree/master/FBRetainCycleDetector).~~ Besides finding leaks in UIView and UIViewController objects, developers can extend it to find leaks in other kinds of objects.\n\n# Communication\nQQ group: 482121244\n\n# Installation\n```\npod 'MLeaksFinder'\n```\nMLeaksFinder comes into effect after `pod install`, there is no need to add any code nor to import any header file.\n\n*WARNING: FBRetainCycleDetector is removed from the podspec due to Facebook's BSD-plus-Patents license. If you want to use FBRetainCycleDetector to find retain cycle, add `pod 'FBRetainCycleDetector'` to your project's Podfile and turn the macro `MEMORY_LEAKS_FINDER_RETAIN_CYCLE_ENABLED` on in `MLeaksFinder.h`.*\n\n# Usage\nMLeaksFinder can automatically find leaks in UIView and UIViewController objects. When leaks happening, it will present an alert with the leaked object in its View-ViewController stack.\n```\nMemory Leak\n(\n    MyTableViewController,\n    UITableView,\n    UITableViewWrapperView,\n    MyTableViewCell\n)\n```\n\nFor the above example, we are sure that objects of `MyTableViewController`, `UITableView`, `UITableViewWrapperView` are deallocated successfully, but not the objects of `MyTableViewCell`.\n\n## Mute Assertion\nIf your class is designed as singleton or for some reason objects of your class should not be dealloced, override `- (BOOL)willDealloc` in your class by returning NO.\n```objc\n- (BOOL)willDealloc {\n    return NO;\n}\n```\n\n## Find Leaks in Other Objects\nMLeaksFinder finds leaks in UIView and UIViewController objects by default. However, you can extend it to find leaks in the whole object graph rooted at a UIViewController object.\n```objc\n- (BOOL)willDealloc {\n    if (![super willDealloc]) {\n        return NO;\n    }\n    \n    MLCheck(self.viewModel);\n    return YES;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencent%2FMLeaksFinder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTencent%2FMLeaksFinder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencent%2FMLeaksFinder/lists"}