“创建和创建”的行为被摧毁”工具中的分配寿命

发布于 2024-12-11 10:16:26 字数 277 浏览 0 评论 0 原文

在工具中使用分配工具时,您可以在 3 个分配生命周期之间进行选择。前两个似乎很明显:

“创建所有对象” - 每个对象
“创造与依然存在”——记忆中的每一个物体

第三个怎么样:“创造与毁灭”?

这是:
1) 在选定的时间跨度内被销毁并在选定的时间跨度内创建的每个对象

2) 自运行开始以来创建的选定时间跨度内被销毁的每个对象(无论选定的时间跨度如何)

仪器指南实际上并未给出任何这些选项的行为。我认为这是猜测 1,但想知道是否有人确切知道。

When using the Allocations instrument in Instruments, you can choose between 3 Allocations Lifespans. The first 2 seem obvious:

"All Objects Created" - Every object
"Created & Still Living" - Every object still in memory

What about the third one: "Created & Destroyed"?

Is this:
1) Every object that was destroyed during the selected timespan AND created during the selected timespan
OR
2) Every object that was destroyed during the selected timespan created since the beginning of the run (regardless of the selected timespan)

The Instruments guide doesn't actually give the behavior of any of these options. I assume it is guess 1, but wonder if anybody knows for sure.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖不如嘢 2024-12-18 10:16:26

您可以通过从跳转栏中选择“调用树”来查看分配寿命的差异。 “使用的字节数”列说明了以下公式:

创建的所有对象 =(创建和仍然存在)+(创建和销毁)

根据我的观察,Instruments 在创建和销毁的生命周期中具有行为 #2。 Instruments 显示被销毁的对象,并且对象何时创建并不重要。

You can see the differences in the allocation lifespans by choosing Call Trees from the jump bar. The Bytes Used column illustrates the following formula:

All Objects Created = (Created and Still Living) + (Created and Destroyed)

From what I've seen, Instruments has behavior #2 for the Created and Destroyed lifespan. Instruments shows the objects that were destroyed, and it doesn't matter when the objects were created.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文