Instruments中CoreGraphics造成的内存占用过大
我正在设备上的 Instruments 中为正在开发的 iPhone 应用程序进行一些性能测试。
我发现分配的两个最大的内存块不是通过我的任何自定义方法(据我所知)。
屏幕截图 1:https://i.sstatic.net/yFFux.png
应用程序的背景它是一个应用程序,它使用 CoreData 来使用 Web 服务并存储/显示数据。然后下载链接的图像(异步),在应用程序中将其大小调整为较小的尺寸,然后显示新图像。我最初认为图像是问题所在,但在离线模式下测试应用程序而没有下载数据或图像,4.5mb 的大型 Malloc 仍然出现。
我正在努力确定内存占用的来源,并最终尝试通过自动释放池或其他方式减少/删除它。
I'm doing some performance testing in Instruments on the device for an iPhone application that is in development.
I'm seeing that the two largest chunks of memory that are been allocated aren't through any of my custom methods (to my knowledge).
Screenshot 1: https://i.sstatic.net/yFFux.png
The background to the application is that it is an application, which uses CoreData to consume a web service and store/display the data. Linked images are then downloaded (async), resized to a smaller size within the app and the new image is then displayed. I originally thought that the images were the problem but testing the app in offline mode without the data or images been downloaded and the large Malloc of 4.5mb still appears.
I'm struggling to identify the source of the memory footprint and ultimately try to reduce/remove it through an AutoRelease pool or another means.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从几张截图中诊断内存问题确实很困难。最好的选择是更多地了解仪器和内存分析,以便您自己确定问题所在。我强烈建议观看 WWDC 2010 会议 310 - 使用仪器进行高级内存分析。它确实帮助我了解了应用程序中的问题所在。
It's really hard to diagnose memory issues from a few screenshots. Your best bet is to learn a bit more about instruments and memory profiling so you can determine for yourself what the problem is. I highly recommend watching the WWDC 2010 session 310 - Advanced Memory Analysis with Instruments. It really helped me to learn where the problems in my app were.