You need to enable JavaScript to run this app.
文档中心
应用性能监控全链路版

应用性能监控全链路版

复制全文
下载 pdf
iOS 端监控
如何屏蔽自动化任务中产生的 OOM 问题
复制全文
下载 pdf
如何屏蔽自动化任务中产生的 OOM 问题
在自动化测试任务中,通常需要通过主动退出来模拟一些场景,达到测试的目的。APMPlus 同样也适配了这种场景,详细原理可参考: iOS性能优化实践:头条抖音如何实现OOM崩溃率下降50%+
但在实际场景中,APMPlus 无法完全适配的自动化场景,一是因为自动化框架比较多,二是也有客户自建自动化框架。在运行自动化测试过程中,SDK 无法识别某些场景的退出,只能将退出归因为 OOM 问题,产生误报。因此,我们为客户暴露了一些接口来标记是否处于自动化场景中,标记之后,在自动化测试过程中不会上报任何 OOM 数据。
说明
  • APMPlus 从 5.1.1 版本起支持本文描述的功能。
#import <RangersAPM+OOMCrashConfig.h>
/**
声明程序运行在自动化测试中。若 isAutoTest 传递为 YES,会屏蔽掉所有的 OOM 问题。默认是NO。
注意:
1. 请不要在生产环境中调用此函数,否则会造成 OOM 数据不会上报。
2. 请在初始化 APM 之前,即 +[RangersAPM startWithConfig:] 函数执行之前,调用该函数。
Declare that the program is running in automated testing. If isAutoTest is passed as YES, all OOM problems will be blocked. Default is NO.
Notice:
1. Please do not call this function in a production environment, otherwise OOM data will not be reported.
2. Call this function before initializing APM, that is, before the +[RangersAPM startWithConfig:] function executes.
*/
[RangersAPM OOMCrashMarkAutoTest:YES];
最近更新时间:2025.09.01 20:17:23
这个页面对您有帮助吗?
有用
有用
无用
无用