Instruments ObjectAlloc:Live Bytes& amp;总字节数 [英] Instruments ObjectAlloc: Explanation of Live Bytes & Overall Bytes

查看:110
本文介绍了Instruments ObjectAlloc:Live Bytes& amp;总字节数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Instument的ObjectAlloc工具,试图了解我的应用程序(iPhone)正在做什么以及它在何时何地进行操作。

I'm using Instument's ObjectAlloc tool in an attempt to understand what the memory my application (iPhone) is doing and when and where it is doing it.

我真的很喜欢这些统计数据的基本解释:

I would really like a basic explanation of these statistics:


  • Live Bytes

  • 生活


  • Transitory


  • 整体字节

  • Live Bytes
  • Living

  • Transitory

  • Overall Bytes

当我想弄清楚我的应用程序使用了多少内存时,我要查看实时字节数或总字节数?这包括泄露的内存吗?什么是Transitory对象?

When I am trying to work out how much memory my application is using, am I to look at Live Bytes or Overall Bytes? Does this include leaked memory? What are Transitory objects?

谢谢

推荐答案

ObjectAlloc 跟踪程序运行时的所有内存分配和释放。

ObjectAlloc tracks all memory allocation and deallocation over the time your program is running.

生活字节或净字节 是您的应用程序使用多少内存在您选择时间轴时。这将包括泄漏的内存,因为泄漏的内存永远不会被释放。

The Living bytes, or Net bytes is how much memory your application is using at the time you select in the timeline. That will include leaked memory, since leaked memory is never deallocated.

#Living 是指特定大小/对象类型的分配数量(并仍然分配)。这在寻找泄漏时非常有用。

#Living is how many allocations of a certain size/object type happened (and are still allocated). This is very useful when looking for leaks.

例如,如果你重复执行一个动作(比如进入一个模态视图控制器),你会看到 #Living 对象每次增长相同的数量,然后你可能会泄漏这些对象。然后,您可以通过向下钻取并查看分配对象的确切代码行来确认,甚至可以查看每个对象的时间索引。

For example, if you repetitively perform an action (like coming in an out of a modal view controller), and you see that #Living of an object grows by the same amount each time, then you're probably leaking those objects. You can then confirm by drilling down and seeing the exact line of code that is allocating the objects, and even see the time index each one was created.

总字节数 包括已发布的内存。为了性能优化目的,跟踪该数字很有用,但如果您只是想查看当前的内存占用或查找泄漏,则不会这样做。

Overall bytes includes memory that has been released. It's useful to track that number for performance optimization purposes, but not if you're just trying to see your current memory footprint or look for leaks.

这篇关于Instruments ObjectAlloc:Live Bytes& amp;总字节数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆