在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:facebookarchive/FBMemoryProfiler开源软件地址:https://github.com/facebookarchive/FBMemoryProfiler开源编程语言:Objective-C 91.6%开源软件介绍:FBMemoryProfilerAn iOS library providing developer tools for browsing objects in memory over time, using FBAllocationTracker and FBRetainCycleDetector. AboutThis library shows how 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) InstallationCarthageTo your Cartfile add:
CocoaPodsTo your podspec add:
You'll be able to use UsageTo start using #import <FBAllocationTracker/FBAllocationTrackerManager.h>
int main(int argc, char * argv[]) {
[[FBAllocationTrackerManager sharedManager] startTrackingAllocations];
[[FBAllocationTrackerManager sharedManager] enableGenerations];
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
} To enable memory profiler: #import <FBMemoryProfiler/FBMemoryProfiler.h>
FBMemoryProfiler *memoryProfiler = [FBMemoryProfiler new];
[memoryProfiler enable];
// Store memory profiler somewhere to extend it's lifetime
_memoryProfiler = memoryProfiler;
We can also define plugins (check below) and filters for retain cycle detector, that we pass to configuration. _memoryProfiler = [[FBMemoryProfiler alloc] initWithPlugins:@[[IncredibleCacheCleaningPlugin new],
[AwesomeLoggerPlugin new]]
retainCycleDetectorConfiguration:someConfigurationWithCustomFilters];
[_memoryProfiler enable]; PluginsPlugins are objects that conform to FBMemoryProfilerPluggable protocol. Example usage: custom cache cleaners, loggers that log data to server. ContributingSee the CONTRIBUTING file for how to help out. LicenseSee (LICENSE) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论