低内存有足够的空RAM

低内存有足够的空RAM

问题描述:

我们当地的低内存警告使用此代码反应警告:低内存有足够的空RAM

- (void)manageMemoryWarning { 
    [[[SPAlertView alloc] initWithTitle:kHinweis message:[WWSError errorTextForCode:WWSErrorSpeicherfastvoll] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Hilfe", nil] show]; 
} 

- (void)start { 
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(manageMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 
} 

- (void)stop { 
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 
} 

虽然有320MB空的RAM空间应用越来越这样的警告,并呈现警报用户。为什么警告被解雇?有足够的空间。

Warning

+0

@HAS警报由didReceiveMemoryWarning方法触发。 – 2015-02-18 14:08:43

的iOS提供了内存不足的警告,当你的应用程序需要它认为是太多RAM。

例如,在iPhone 4,它具有512 MB的RAM,操作系统会给你低内存警告,一旦你的应用程序越过256

粗略地讲,将iOS版,如果你尝试分配打搅你,无论其他应用占用多少内存,该设备的RAM的一半以上。

+1

但我们正在使用50MB的iPad 512MB ...这远远低于256. – 2015-02-11 15:57:24

+0

我不知道碎片是否与此有关。你关闭并重新启动iPad? (我敢打赌,你有)我四处寻找一个工具,我曾经发现,让你分配内存,并显示警告时发生...... – Almo 2015-02-11 16:06:07

+0

感谢您的提示。我不止一次地关闭了iPad ......但它没有帮助。 – 2015-02-12 07:10:16