XCode Instruments 分配:查看实时字节数还是总体字节数?
我在 iOS 应用程序中收到一些内存警告,因此我正在运行 Instruments 来查看分配情况。我应该查看 * 所有分配 * 活动字节数还是总体字节数?
有人说,如果我使用 22MB,iOS 可以关闭我的应用程序,这是来自 Live 还是 Total bytes 部分?
I am getting some memory warning in my iOS app so I am running Instruments to see the allocations. Should I look at the * All Allocations * Live Bytes or Overall Bytes?
Someone said the iOS can close my app if I use for 22MB, is that from the Live or Overall bytes section?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Live Bytes 是当前的使用情况,也是您感兴趣的内容,总体字节数包括所有已释放的分配。另一件事是查看图表并寻找峰值。举个例子,我在我正在开发的一个应用程序中看到了大约 27MB 的巨大峰值,我知道我能够将峰值内存使用量减少到 8MB。
另外,当您使用应用程序时,请注意,随着时间的推移,内存可能会大量增长,但不会泄漏,只是不再使用。
有关内存列的说明,请参阅实时字节说明&总字节数。
Live Bytes is the current usage and is what you are interested in, overall bytes includes all released allocation. The other thing is to look at the graph and look for peaks. As an example I saw a huge peak of about 27MB in an app I was working on, knowing that I was able to reduce peak memory usage to 8MB.
Also watch over time as you exercise your app, it is possible to have substantial memory growth over time that is not leaked, just not not used anymore.
For a description of the memory columns see Explanation of Live Bytes & Overall Bytes.