All Projects → Tencent → Oomdetector

Tencent / Oomdetector

Licence: other
OOMDetector is a memory monitoring component for iOS which provides you with OOM monitoring, memory allocation monitoring, memory leak detection and other functions.

Programming Languages

Objective-C++
1391 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Oomdetector

evildork
Evildork targeting your fiancee👁️
Stars: ✭ 46 (-97.76%)
Mutual labels:  leak
Nativeleakdetector
Win32 memory leak detector with ETW
Stars: ✭ 30 (-98.54%)
Mutual labels:  leak
Koom
KOOM is an OOM killer on mobile platform by Kwai.
Stars: ✭ 2,247 (+9.29%)
Mutual labels:  oom
whatsipp
🎭 WhatsApp user’s IP disclosure with link preview
Stars: ✭ 37 (-98.2%)
Mutual labels:  leak
Gg Shield
Detect secret in source code, scan your repo for leaks. Find secrets with GitGuardian and prevent leaked credentials. GitGuardian is an automated secrets detection & remediation service.
Stars: ✭ 708 (-65.56%)
Mutual labels:  leak
Awesome Sec S3
A collection of awesome AWS S3 tools that collects and enumerates exposed S3 buckets
Stars: ✭ 76 (-96.3%)
Mutual labels:  leak
BLUELAY
Searches online paste sites for certain search terms which can indicate a possible data breach.
Stars: ✭ 24 (-98.83%)
Mutual labels:  leak
Rxlifecycle
Rx binding of stock Android Activities & Fragment Lifecycle, avoiding memory leak
Stars: ✭ 131 (-93.63%)
Mutual labels:  leak
Cstrike15 src
Leak of CS:GO Source code, provided by yours truly so go rep me
Stars: ✭ 745 (-63.76%)
Mutual labels:  leak
Rootviewcontrollerswitcher
Stars: ✭ 105 (-94.89%)
Mutual labels:  leak
AMLeaksFinder
A small tool for automatically detecting the [controller, view memory leak] in the project. 一款用于自动检测项目中【控制器内存泄漏,View 内存泄漏】的小工具,支持 ObjC,Swift。
Stars: ✭ 89 (-95.67%)
Mutual labels:  leak
Linux.mirai
Leaked Linux.Mirai Source Code for Research/IoC Development Purposes
Stars: ✭ 466 (-77.33%)
Mutual labels:  leak
Nuxt Memwatch
Quickly watch real-time memory stats of your nuxt app
Stars: ✭ 76 (-96.3%)
Mutual labels:  leak
WebRTC-Leak-Prevent-Toggle
Toggle WebRTC leak prevention in Chromium browsers.
Stars: ✭ 16 (-99.22%)
Mutual labels:  leak
H8mail
Email OSINT & Password breach hunting tool, locally or using premium services. Supports chasing down related email
Stars: ✭ 2,163 (+5.2%)
Mutual labels:  leak
TBOOMDetector
Detect Out Of Memory events in an iOS app
Stars: ✭ 44 (-97.86%)
Mutual labels:  oom
Ail Framework
AIL framework - Analysis Information Leak framework
Stars: ✭ 1,091 (-46.94%)
Mutual labels:  leak
Cr3dov3r
Know the dangers of credential reuse attacks.
Stars: ✭ 1,700 (-17.32%)
Mutual labels:  leak
Vpnfailsafe
IP leak prevention for OpenVPN
Stars: ✭ 130 (-93.68%)
Mutual labels:  leak
Ghhdb Github Hacking Database
Github Hacking Database - My personal collection of Github Dorks to search for Confidential Information (Yes, it's a Github version of Google Dorks)
Stars: ✭ 92 (-95.53%)
Mutual labels:  leak

简介

OOMDetector是一个iOS内存监控组件,应用此组件可以帮助你轻松实现OOM监控、大内存分配监控、内存泄漏检测等功能。

特性

  • 1.OOM监控:监控OOM,Dump引起爆内存的堆栈
  • 2.大内存分配监控:监控单次大块内存分配,提供分配堆栈信息
  • 3.内存泄漏检测:可检测OC对象、Malloc堆内存泄漏,提供泄漏堆栈信息

演示

demo_gif

支持CocoaPods

在Podfile中添加如下文本

  pod 'OOMDetector', '1.3'

然后在命令行中运行

  pod install

需要注意的是OOMDetector使用了fishhook (0.2) 如果你的工程中也使用了fishhook,建议移除,并统一使用CocoaPods管理

  pod 'fishhook', '0.2'

堆栈翻译

  translate_oom.py dsym_file oom_file

dsym_file app的符号表路径,如OOMDetector.app.dSYM

oom_file Library/OOMDetector路径下的爆内存日志,如normal_malloc20180125_211259558.log

使用方法

初始化

// 初始化,6s以下机型内存触顶阈值默认设置为300M,6s及以上机型内存触顶阈值默认设置为800M。

- (void)setupWithDefaultConfig;

OOM监控

// 开启OOM监控,默认在setupWithDefaultConfig方法中已经开启

-(void)startMaxMemoryStatistic:(double)overFlowLimit;

大内存分配监控

// 开启单次大内存分配监控

-(BOOL)startSingleChunkMallocDetector:(size_t)threshholdInBytes callback:(ChunkMallocBlock)callback;

内存泄漏检测

// 初始化内存泄漏监控器,记录所有堆对象

- (void)setupLeakChecker;

// 执行一次泄露检测,建议在主线程调用,该操作会挂起所有子线程进行泄露检测(该操作较耗时,平均耗时在1s以上,请限制调用频率)

-(void)executeLeakCheck:(QQLeakCheckCallback)callback;

其它功能

// 开启堆内存堆栈监控,开启后会实时记录所有的内存分配堆栈,并将多次重复调用的相同堆栈合并,如果合并后的size大于threshHoldInbytes,该分配堆栈将被输出到log用于分析,log路径Library/OOMDetector

-(BOOL)startMallocStackMonitor:(size_t)threshholdInBytes needAutoDumpWhenOverflow:(BOOL)needAutoDump dumpLimit:(double)dumpLimit sampleInterval:(NSTimeInterval)sampleInterval;

// 开启VMStackMonitor用以监控非直接通过malloc方式分配的内存因为startVMStackMonitor:方法用到了私有API __syscall_logger会带来app store审核不通过的风险,此方法默认只在DEBUG模式下生效,如果需要在RELEASE模式下也可用,请打开USE_VM_LOGGER_FORCEDLY宏,但是切记在提交appstore前将此宏关闭,否则可能会审核不通过

-(BOOL)startVMStackMonitor:(size_t)threshHoldInbytes;

设置代理

@protocol QQOOMPerformanceDataDelegate // 在调用startMaxMemoryStatistic:开启内存触顶监控后会触发此回调,返回前一次app运行时单次生命周期内的最大物理内存数据

-(void)performanceData:(NSDictionary *)data completionHandler:(void (^)(BOOL))completionHandler; @end

@protocol QQOOMFileDataDelegate // 在出现单次大块内存分配、检查到内存泄漏且时、调用uploadAllStack方法时触发此回调

-(void)fileData:(NSData *)data extra:(NSDictionary<NSString *,NSString *> *)extra type:(QQStackReportType)type completionHandler:(void (^)(BOOL))completionHandler; @end

PS

如果你遇到类似"Undefined symbols for architecture arm64: "std::__1::__next_prime(unsigned long)""的链接问题, 你可以做如下设置:

Build Settings -> Linking -> Other Linker Flags -> -lc++

变更记录

暂无

帮助

暂无

许可证

OOMDetector适用MIT协议,详见LICENSE


Introduction

OOMDetector is a memory monitoring component for iOS which provides you with OOM monitoring, memory allocation monitoring, memory leak detection and other functions.

Features

  • OOM Monitoring : Monitoring OOM then dump stacks which cause OOM problems.
  • Large Memory Allocation Monitoring : Monitoring large memory allocation then provides memory allocation stacks for you.
  • Memory Leak Detecting : Detecting memory leak for both OC objects and c heap memory then provides memory allocation stacks for you.

Demo

demo_gif

Usage

Initialization

// 初始化,6s以下机型内存触顶阈值默认设置为300M,6s及以上机型内存触顶阈值默认设置为800M。

- (void)setupWithDefaultConfig;

OOM Monitoring

// 开启OOM监控,默认在setupWithDefaultConfig方法中已经开启

-(void)startMaxMemoryStatistic:(double)overFlowLimit;

Large Memory Allocation Monitoring

// 开启单次大内存分配监控

-(BOOL)startSingleChunkMallocDetector:(size_t)threshholdInBytes callback:(ChunkMallocBlock)callback;

Memory Leak Detecting

// 初始化内存泄漏监控器,记录所有堆对象

- (void)setupLeakChecker;

// 执行一次泄露检测,建议在主线程调用,该操作会挂起所有子线程进行泄露检测(该操作较耗时,平均耗时在1s以上,请限制调用频率)

-(void)executeLeakCheck:(QQLeakCheckCallback)callback;

Other Functions

// 开启堆内存堆栈监控,开启后会实时记录所有的内存分配堆栈,并将多次重复调用的相同堆栈合并,如果合并后的size大于threshHoldInbytes,该分配堆栈将被输出到log用于分析,log路径Library/OOMDetector

-(BOOL)startMallocStackMonitor:(size_t)threshholdInBytes needAutoDumpWhenOverflow:(BOOL)needAutoDump dumpLimit:(double)dumpLimit sampleInterval:(NSTimeInterval)sampleInterval;

// 开启VMStackMonitor用以监控非直接通过malloc方式分配的内存因为startVMStackMonitor:方法用到了私有API __syscall_logger会带来app store审核不通过的风险,此方法默认只在DEBUG模式下生效,如果需要在RELEASE模式下也可用,请打开USE_VM_LOGGER_FORCEDLY宏,但是切记在提交appstore前将此宏关闭,否则可能会审核不通过

-(BOOL)startVMStackMonitor:(size_t)threshHoldInbytes;

Delegate

@protocol QQOOMPerformanceDataDelegate // 在调用startMaxMemoryStatistic:开启内存触顶监控后会触发此回调,返回前一次app运行时单次生命周期内的最大物理内存数据

-(void)performanceData:(NSDictionary *)data completionHandler:(void (^)(BOOL))completionHandler; @end

@protocol QQOOMFileDataDelegate // 在出现单次大块内存分配、检查到内存泄漏且时、调用uploadAllStack方法时触发此回调

-(void)fileData:(NSData *)data extra:(NSDictionary<NSString *,NSString *> *)extra type:(QQStackReportType)type completionHandler:(void (^)(BOOL))completionHandler; @end

PS

If you come across link errors like "Undefined symbols for architecture arm64: "std::__1::__next_prime(unsigned long)"", do as follows:

Build Settings -> Linking -> Other Linker Flags -> -lc++

Known Issues

Conflict with fishhook

现在已知Podfile中有FBRetainCycleDetector时会有编译错误,原因是FBRetainCycleDetector中包含了fishhook,目前遇到这种情况,请先移除FBRetainCycleDetector,然后再pod install试试

Changes Log

Help

License

OOMDetector is under the MIT license. See the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].