美文网首页
Instrumets

Instrumets

作者: Harely | 来源:发表于2019-10-16 16:14 被阅读0次

Message from debugger: Terminated due to memory issue

内存一直增长,导致无法释放,程序闪退。
  使用InstrumentAllocations检查内存增长,对于一些临时产生的对象使用@autorelease进行释放。

选择Allocations

选择 Allocations

Allocations 配置

配置

选择真机,运行查找内存Boss

检测内存增长的 boss

解决方法:清理内存

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    //bug: 加载太多图片crash
    [SDImageCache sharedImageCache].config.shouldCacheImagesInMemory = NO;
    [[SDImageCache sharedImageCache] clearDiskOnCompletion:nil];
    [[SDImageCache sharedImageCache] clearMemory];
}

相关文章

  • Instrumets

    Message from debugger: Terminated due to memory issue 内存一...

网友评论

      本文标题:Instrumets

      本文链接:https://www.haomeiwen.com/subject/ttjumctx.html