内存使用量超过iOS中的物理限制(使用ARC)

时间:2015-08-18 11:22:59

标签: ios objective-c memory-management automatic-ref-counting

我有2个视图控制器,A和B.我目前在A上,我有一个按钮,它带我到B.现在,我正在测试这个应用程序的内存使用情况,我发现从A来回来回 - > B占用了大量的内存。我也附上了.trace文件。它超过1GB,这是物理RAM限制。我知道有虚拟内存概念来处理这种情况。但是,我想知道为什么iOS没有杀死我的应用程序?

请帮助我理解这一点。

(警告:我已压缩文件并将其缩小为226 MB,原始文件为1.06 GB)

链接到Instruments4.trace文件:https://drive.google.com/file/d/0B3PZzP2RSGt4dFBFVTNrSVV3eFU/view?usp=sharing

修改

-(void)presentSearchScene
{
    if ([[[[self.navigationController viewControllers][0] class] description] isEqualToString:@"SearchVC"])
    {
        [self.navigationController popToRootViewControllerAnimated:YES];
    }
    else
    {
        [self.navigationController presentViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"navSearch"] animated:NO completion:^{

        }];
    }
}

我认为问题在于我首先提供视图控制器而不创建它的属性。我会这样做并在这里更新问题。

0 个答案:

没有答案
相关问题