Name: FBMemoryProfiler
Owner: Facebook
Description: iOS tool that helps with profiling iOS Memory usage.
Created: 2016-04-07 18:24:13.0
Updated: 2018-01-13 15:01:25.0
Pushed: 2017-10-27 00:54:18.0
Homepage: null
Size: 1829
Language: Objective-C
GitHub Committers
User | Most Recent Commit | # Commits |
---|---|---|
Dave Lee | 2016-08-29 14:37:14.0 | 3 |
Steffen Matthischke | 2016-04-18 21:12:58.0 | 1 |
Björn Dahlgren | 2016-04-15 07:45:59.0 | 1 |
Michael Berg | 2016-04-23 04:13:25.0 | 1 |
Grzegorz Pstrucha | 2016-10-17 16:56:34.0 | 13 |
Minyoung Kim | 2016-08-29 14:14:10.0 | 1 |
Pei Hsuan Chang | 2016-04-29 05:25:31.0 | 1 |
Adel MEZARA | 2016-04-19 12:45:49.0 | 2 |
Other Committers
User | Most Recent Commit | # Commits | |
---|---|---|---|
armingli | armingli@tencent.com | 2016-10-14 09:49:25.0 | 1 |
Dave Lee | kastiglione@fb.com | 2016-04-13 21:24:42.0 | 1 |
Mihai Babusca | mihai.babusca@woowteam.com | 2016-07-21 13:29:56.0 | 1 |
phchang | phchang@yahoo-inc.com | 2016-05-01 05:15:01.0 | 1 |
Yen-Chia Lin | yen-chia.lin@runtastic.com | 2016-04-28 12:26:33.0 | 1 |
An iOS library providing developer tools for browsing objects in memory over time, using FBAllocationTracker and FBRetainCycleDetector.
This library shows how FBAllocationTracker
and FBRetainCycleDetector
can cooperate together, and how they can be used in real app.
It uses FBAllocationTracker to gather information about the objects. It supports generations and retain cycle detection.
Here is a small demo (project is available in Example directory)
To your Cartfile add:
github "facebook/FBMemoryProfiler"
FBMemoryProfiler
is built out from non-debug builds, so when you want to test it, use
carthage update --configuration Debug
To your podspec add:
pod 'FBMemoryProfiler'
You'll be able to use FBMemoryProfiler
fully only in Debug
builds. This is controlled by compilation flag that can be provided to the build to make it work in other configurations.
To start using FBMemoryProfiler
you'll first need to enable FBAllocationTracker
.
ort <FBAllocationTracker/FBAllocationTrackerManager.h>
main(int argc, char * argv[]) {
FBAllocationTrackerManager sharedManager] startTrackingAllocations];
FBAllocationTrackerManager sharedManager] enableGenerations];
utoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
To enable memory profiler:
ort <FBMemoryProfiler/FBMemoryProfiler.h>
moryProfiler *memoryProfiler = [FBMemoryProfiler new];
oryProfiler enable];
tore memory profiler somewhere to extend it's lifetime
oryProfiler = memoryProfiler;
FBMemoryProfiler
will show up as a button on the screen. Once tapped, it will open memory profiler in full size mode.
We can also define plugins (check below) and filters for retain cycle detector, that we pass to configuration.
oryProfiler = [[FBMemoryProfiler alloc] initWithPlugins:@[[IncredibleCacheCleaningPlugin new],
[AwesomeLoggerPlugin new]]
retainCycleDetectorConfiguration:someConfigurationWithCustomFilters];
moryProfiler enable];
Plugins are objects that conform to FBMemoryProfilerPluggable protocol. Example usage: custom cache cleaners, loggers that log data to server.
See the CONTRIBUTING file for how to help out.