(iphone) UIImage memory management problem.
来源:互联网 发布:淘宝刷到皇冠多少钱 编辑:程序博客网 时间:2024/05/17 09:22
问题:
I'm having trouble with UIImage memory management.
(iphone) my app gets memory warning when instruments shows "all allocations" only 7mb ?
Essentially, I create/destroy UIImage many times.
Even if I make memory consumption at a time low using local NSAutoreleasePool, iphone/ipad device keeps complaining about memory usage.
I'm thinking, I should allocate UIImage to specific memory buffer(or pool of buffer) which I can designate to.
Is this possible?
Or any other suggestion on how to create/destroy UIImages many times without upsetting iOS would be much appreciated.
Thank you.
回答:
It is not a well known fact, but Instruments does not consider the size of UIImages within the allocated memory. You could be leaking 100Mb of UIImages and the allocated memory would not tell the story. What does tell the story is the number of live UIImage instances at a given moment.
In the Allocations instrument, using the top-right search box, search for "Image". Then look for the column labeled #linving in UIImage. That number is the number of UIImage objects. That is a better compass in to figuring out where are your UIImages going. If at some point you have more objects than what you expect, and thease UImages are not going away you have a UIImage leak in your hands. An UIImage leak will kill your app real fast.
- (iphone) UIImage memory management problem.
- iPhone Memory Management Tips
- Memory Management
- Memory Management
- Memory management
- Memory Management
- Memory management
- Memory Management
- Memory management
- Memory Management
- Memory Management
- memory management
- Iphone UIImage
- Memory Problem
- 8.4 Automatic memory management
- 10.9 Automatic memory management
- c memory management(zz)
- Virtual memory management
- Linux编辑器--vim的tag29.2
- Linux编辑器--vim的tag29.3
- Linux编辑器--vim的tag29.4
- 6个变态的C语言Hello World程序 (我相信你做不出来!)
- Linux编辑器--vim的tag29.5
- (iphone) UIImage memory management problem.
- APDU命令
- linux下设置定时任务-cron使用
- Boost学习系列2-智能指针(下)
- 粘包问题
- [UIImage imageNamed…] vs [UIImage imageWithData…]
- 使用T-SQL连接另一SQL实例,读取数据表(备忘)
- 使用Vim打造IDE--高亮显示
- POJ 1328 Radar Installation