codecamp

tt.onMemoryWarning

基础库 1.28.0 开始支持本方法,低版本需做兼容处理

注册监听内存不足警告函数。

当手机内存占用过高时,触注册函数。

该事件不会杀掉小程序, 建议开发者可以在接受到报警后释放相关不必要的资源。


参数

function callback

内存不足警告函数


代码示例

tt.onMemoryWarning(function() {
  console.log("onMemoryWarning");
});
Performance
Performance.now
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定