2013-02-19 25 views
0

我已经尝试了很多,以阻止来自我的应用程序的所有泄漏。但是,当我从 服务器同步大量数据,然后我的ios应用程序泄漏内存。清理ios中的所有内存泄漏

现在我想要在间隔一段时间后清除所有泄漏的内存,或者您可以说每当我接到函数调用时。

-(void)didReceiveMemoryWarning 
{ 
    [super didReceiveMemoryWarning]; 

    UIAlertView* alertobj = [[UIAlertView alloc] initWithTitle:@"Info" message:@"This Application facing memory issue." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
    [alertobj show]; 

    NSLog(@"memory issue occur"); 
    // Dispose of any resources that can be recreated. 
} 

有没有什么办法?

回答

0

不,你不能那样做。

我遇到类似的问题,在更小的块同步数据和了解@autoreleasepool

我基本上同步在一个时间对象500〜1500〜这取决于有多少数据中的对象,在@autoreleasepool包装他们一旦我完成了这些对象,就可以让记忆保持低水平。