iPhone App 现在进入到了iOS4时代,内存问题越来越重要了,以前的iOS都是单任务的,内存还算够用,现在iOS4推出了多任务系统,越来越多的程序占了内存以后,在后台又不释放,使用者也往往会忘记在后台杀掉其他程序的进程,导致现在的程序经常会遇到内存不够用的情况,真不知道这个多任务系统是好是坏丫。
总之,作为一个程序员,有bug就得处理,没办法。。。
接收到内存不够警告很有必要,使用
- (void)didReceiveMemoryWarning {
?????????[super didReceiveMemoryWarning];
?????????//TO DO:
}
如果内存不够用,这个方法就能触发了。这时候,建议你释放一些必不要的数据以便腾出足够的内存。
好吧,我承认前面都是废话,下面写点有用的, 关于内存警告级别的解释:
There are 4 levels of warnings (0 to 3). These are set from the kernel memory watcher, and can be obtained by the not-so-public function OSMemoryNotificationCurrentLevel().
typedef enum {
????OSMemoryNotificationLevelAny??????= -1,
????OSMemoryNotificationLevelNormal???=??0,
????OSMemoryNotificationLevelWarning??=??1,
????OSMemoryNotificationLevelUrgent???=??2,
????OSMemoryNotificationLevelCritical =??3
} OSMemoryNotificationLevel;
How the levels are triggered is not documented. SpringBoard is configured to do the following in each memory level:
????1.????Warning (not-normal) — Relaunch, or delay auto relaunch of nonessential background apps e.g. Mail.
????2.????Urgent — Quit all background apps, e.g. Safari and iPod.
????3.????Critical and beyond — The kernel will take over, probably killing SpringBoard or even reboot.
Killing the active app (jetsam) is not handled by SpringBoard, but launchd.
根据我的理解,2级以前的警告都可以无视,2级的警告老实说,有点危险,但是我个人的体会是,其实也可以凑合了^_^
因为你如果使用了照相机的话,2级警告其实比较常见
详细解决方案
(转)关于iPhone App的 Memory warning的1点东西
热度:111 发布时间:2016-04-25 06:34:42.0
相关解决方案
- j地图命令(Java Memory Map)
- out of Memory Error java/lang/OutOfMemortyError,该怎么解决
- iphone 模拟器,该如何处理
- VS2003 proj 用VS2008编译,有个Warning ,请教是什么意思?---cl: 命令行 warning D9035 :“Wp64”选项已否决,并将在将来的版本中移除
- 有哪位高手用过JPlayer ,进来一下,IPHONE 等设备播放有关问题
- Web应用“无法操作保护内存”错误,Attempted to read or write protected memory
- ASP程序出现如下异常怎么解决?[Microsoft][ODBC Visual FoxPro Driver]SQL: Out of memory
- oracle范例无法启动 out of memory
- oracle实例无法启动 out of memory,该如何处理
- 单个人去做手机开发选什么平台好?android,iphone?解决办法
- 请教freescale 8156 DSP的L1,L2,L3 memory 是什么
- LIST MEMORY 能显示其他应用程序的内存变量吗?解决方案
- LIST MEMORY 会显示其他应用程序的内存变量吗
- dbf数据大,处理时提示 "not enought memory for file map"该怎么解决
- 对于手机android iphone ipad 在线播放视频,服务器需要哪些要求呢?该怎么解决
- detected wrote memory end of heap解决方案
- >>> PayPal mobile for Android / iPhone 开发包 开放啦!
- [求助]怎么解决 "Out of memory in function ..." 问题
- aspnet_wp.exe (PID: 3300) was recycled because memory consumption exceeded the 四
- 编译安装php时碰到virtual memory exhausted: Cannot allocate memory
- Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resourc解决办法
- iphone + html5是个美模式
- PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in,该如何处理
- ipad 和 iphone 上的有关问题
- Fatal error: Out of memory (allocated 1916534784) (tried to allocate 44 bytes)解决办法
- Apache报“ Memory allocation failed `Not enough space”,该怎么解决
- Warning Cannot send session cookie - headers already sent.有关问题的解决(PHP的UTF-8 BOM引
- PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0 解决方法
- iPhone 筹建PHP版Push服务器 实例操作
- 登陆顺利 Warning: Cannot modify header information - headers already sent by (output