{"id":877,"url":"https://github.com/facebookarchive/FBMemoryProfiler","last_synced_at":"2025-07-30T19:33:05.372Z","repository":{"id":56910296,"uuid":"55717949","full_name":"facebookarchive/FBMemoryProfiler","owner":"facebookarchive","description":"iOS tool that helps with profiling iOS Memory usage.","archived":true,"fork":false,"pushed_at":"2020-04-25T15:58:50.000Z","size":1840,"stargazers_count":3413,"open_issues_count":20,"forks_count":400,"subscribers_count":140,"default_branch":"master","last_synced_at":"2024-04-08T00:14:51.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/facebookarchive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-07T18:24:13.000Z","updated_at":"2024-03-17T23:50:32.000Z","dependencies_parsed_at":"2022-08-20T19:40:06.276Z","dependency_job_id":null,"html_url":"https://github.com/facebookarchive/FBMemoryProfiler","commit_stats":null,"previous_names":["facebook/fbmemoryprofiler"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2FFBMemoryProfiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2FFBMemoryProfiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2FFBMemoryProfiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookarchive%2FFBMemoryProfiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebookarchive","download_url":"https://codeload.github.com/facebookarchive/FBMemoryProfiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228179008,"owners_count":17881121,"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.645Z","updated_at":"2024-12-04T19:32:18.614Z","avatar_url":"https://github.com/facebookarchive.png","language":"Objective-C","funding_links":[],"categories":["Code Quality","HarmonyOS","Objective-C"],"sub_categories":["Windows Manager"],"readme":"# FBMemoryProfiler\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods](https://img.shields.io/cocoapods/v/FBMemoryProfiler.svg?maxAge=2592000)]()\n\n\nAn iOS library providing developer tools for browsing objects in memory over time, using [FBAllocationTracker](https://github.com/facebook/FBAllocationTracker) and [FBRetainCycleDetector](https://github.com/facebook/FBRetainCycleDetector).\n\n## About\n\nThis library shows how `FBAllocationTracker` and `FBRetainCycleDetector` can cooperate together, and how they can be used in real app.\n\nIt uses [FBAllocationTracker](https://github.com/facebook/FBAllocationTracker) to gather information about the objects. \nIt supports [generations](https://github.com/facebook/FBAllocationTracker#generations) and [retain cycle detection](https://github.com/facebook/FBRetainCycleDetector).\n\nHere is a small demo (project is [available in Example directory](Example/))\n\n\u003cimg src=\"Example/Images/Example2.gif\" width=450/\u003e\n\n## Installation\n\n### Carthage\n\nTo your Cartfile add: \n\n    github \"facebook/FBMemoryProfiler\"\n\n`FBMemoryProfiler` is built out from non-debug builds, so when you want to test it, use \n\n    carthage update --configuration Debug\n\n### CocoaPods\n\nTo your podspec add:\n\n    pod 'FBMemoryProfiler'\n\nYou'll be able to use `FBMemoryProfiler` fully only in `Debug` builds. This is controlled by [compilation flag](FBMemoryProfiler/FBMemoryProfiler.h#L29) that can be provided to the build to make it work in other configurations.\n\n## Usage\n\nTo start using `FBMemoryProfiler` you'll first need to enable `FBAllocationTracker`.\n\n```objc\n#import \u003cFBAllocationTracker/FBAllocationTrackerManager.h\u003e\n\nint main(int argc, char * argv[]) {\n  [[FBAllocationTrackerManager sharedManager] startTrackingAllocations];\n  [[FBAllocationTrackerManager sharedManager] enableGenerations];\n  @autoreleasepool {\n      return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));\n  }\n}\n```\n\nTo enable memory profiler:\n\n```objc\n#import \u003cFBMemoryProfiler/FBMemoryProfiler.h\u003e\n\nFBMemoryProfiler *memoryProfiler = [FBMemoryProfiler new];\n[memoryProfiler enable];\n\n// Store memory profiler somewhere to extend it's lifetime\n_memoryProfiler = memoryProfiler;\n```\n\n`FBMemoryProfiler` will show up as a button on the screen. Once tapped, it will open memory profiler in full size mode.\n\nWe can also define plugins (check below) and [filters for retain cycle detector](https://github.com/facebook/FBRetainCycleDetector#filters), that we pass to configuration.\n\n```objc\n_memoryProfiler = [[FBMemoryProfiler alloc] initWithPlugins:@[[IncredibleCacheCleaningPlugin new],\n                                                              [AwesomeLoggerPlugin new]]\n                           retainCycleDetectorConfiguration:someConfigurationWithCustomFilters];\n[_memoryProfiler enable];\n```\n\n## Plugins\n\nPlugins are objects that conform to [FBMemoryProfilerPluggable](FBMemoryProfiler/Options/FBMemoryProfilerPluggable.h) protocol. Example usage: [custom cache cleaners](Example/ExampleApp/CacheCleanerPlugin.h), [loggers that log data to server](Example/ExampleApp/RetainCycleLoggerPlugin.h).\n\n## Contributing\nSee the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.\n\n## License\nSee (LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookarchive%2FFBMemoryProfiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebookarchive%2FFBMemoryProfiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookarchive%2FFBMemoryProfiler/lists"}