Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gsdios authored Jan 8, 2018
1 parent f6e8624 commit 948c3f6
Showing 1 changed file with 49 additions and 48 deletions.
97 changes: 49 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@

## Introduction

OOMDetector is a memory monitoring component for iOS which provides you with OOM monitoring, memory allocation monitoring, memory leak detection and other functions.
## 简介
OOMDetector是一个iOS内存监控组件,应用此组件可以帮助你轻松实现OOM监控、大内存分配监控、内存泄漏检测等功能。

## 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.
## 特性

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

## Demo
## 演示
![demo_gif](assets/oomgif.gif)

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

\- (void)setupWithDefaultConfig;
### OOM Monitoring
// 开启OOM监控,默认在setupWithDefaultConfig方法中已经开启
### OOM监控
// 开启OOM监控,默认在setupWithDefaultConfig方法中已经开启

\-(void)startMaxMemoryStatistic:(double)overFlowLimit;
### Large Memory Allocation Monitoring
### 大内存分配监控
// 开启单次大内存分配监控

\-(BOOL)startSingleChunkMallocDetector:(size_t)threshholdInBytes callback:(ChunkMallocBlock)callback;
### Memory Leak Detecting
### 内存泄漏检测

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

Expand All @@ -34,8 +33,8 @@ OOMDetector is a memory monitoring component for iOS which provides you with OOM
// 执行一次泄露检测,建议在主线程调用,该操作会挂起所有子线程进行泄露检测(该操作较耗时,平均耗时在1s以上,请限制调用频率)

\-(void)executeLeakCheck:(QQLeakCheckCallback)callback;

### Other Functions
### 其它功能

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

Expand All @@ -45,7 +44,7 @@ OOMDetector is a memory monitoring component for iOS which provides you with OOM

\-(BOOL)startVMStackMonitor:(size_t)threshHoldInbytes;

### Delegate
### 设置代理

@protocol QQOOMPerformanceDataDelegate <NSObject>
// 在调用startMaxMemoryStatistic:开启内存触顶监控后会触发此回调,返回前一次app运行时单次生命周期内的最大物理内存数据
Expand All @@ -60,47 +59,49 @@ OOMDetector is a memory monitoring component for iOS which provides you with OOM
@end

## PS
If you come across link errors like "Undefined symbols for architecture arm64:
"std::__1::__next_prime(unsigned long)"", do as follows:
如果你遇到类似"Undefined symbols for architecture arm64:
"std::__1::__next_prime(unsigned long)""的链接问题, 你可以做如下设置:

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

## 变更记录
暂无
## 帮助
暂无
## 许可证
OOMDetector适用MIT协议,详见[LICENSE](/LICENSE)

## Changes Log

## Help

## License
OOMDetector is under the MIT license. See the [LICENSE](/LICENSE) file for details.

****

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

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

- 1.OOM监控:监控OOM,Dump引起爆内存的堆栈
- 2.大内存分配监控:监控单次大块内存分配,提供分配堆栈信息
- 3.内存泄漏检测:可检测OC对象、Malloc堆内存泄漏,提供泄漏堆栈信息
## 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](assets/oomgif.gif)

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

\- (void)setupWithDefaultConfig;
### OOM监控
// 开启OOM监控,默认在setupWithDefaultConfig方法中已经开启
### OOM Monitoring
// 开启OOM监控,默认在setupWithDefaultConfig方法中已经开启

\-(void)startMaxMemoryStatistic:(double)overFlowLimit;
### 大内存分配监控
### Large Memory Allocation Monitoring
// 开启单次大内存分配监控

\-(BOOL)startSingleChunkMallocDetector:(size_t)threshholdInBytes callback:(ChunkMallocBlock)callback;
### 内存泄漏检测
### Memory Leak Detecting

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

Expand All @@ -109,8 +110,8 @@ OOMDetector是一个iOS内存监控组件,应用此组件可以帮助你轻松
// 执行一次泄露检测,建议在主线程调用,该操作会挂起所有子线程进行泄露检测(该操作较耗时,平均耗时在1s以上,请限制调用频率)

\-(void)executeLeakCheck:(QQLeakCheckCallback)callback;
### 其它功能

### Other Functions

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

Expand All @@ -120,7 +121,7 @@ OOMDetector是一个iOS内存监控组件,应用此组件可以帮助你轻松

\-(BOOL)startVMStackMonitor:(size_t)threshHoldInbytes;

### 设置代理
### Delegate

@protocol QQOOMPerformanceDataDelegate <NSObject>
// 在调用startMaxMemoryStatistic:开启内存触顶监控后会触发此回调,返回前一次app运行时单次生命周期内的最大物理内存数据
Expand All @@ -135,15 +136,15 @@ OOMDetector是一个iOS内存监控组件,应用此组件可以帮助你轻松
@end

## PS
如果你遇到类似"Undefined symbols for architecture arm64:
"std::__1::__next_prime(unsigned long)""的链接问题, 你可以做如下设置:
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++

## 变更记录
暂无
## 帮助
暂无
## 许可证
OOMDetector适用MIT协议,详见[LICENSE](/LICENSE)

## Changes Log

## Help

## License
OOMDetector is under the MIT license. See the [LICENSE](/LICENSE) file for details.

0 comments on commit 948c3f6

Please sign in to comment.