Android - 内存分配跟踪器未跟踪我的测试分配

发布于 2024-10-10 14:38:01 字数 291 浏览 0 评论 0原文

我目前正在研究 DDMS 工具的内存分配跟踪器。 在我的项目中,我在按钮的 onClickListener 中插入以下行:

memTrackerTest = new byte[1024*1024];

memTrackerTest 是 Activity 的私有变量。

我希望在跟踪器中看到分配,但不幸的是它没有出现。 我的代码的其他部分,例如 ProgressDialog 的创建,显示得很好。

知道为什么我的大分配没有显示在分配跟踪器中吗?

I'm currently playing around with the memory allocation tracker of the DDMS tool.
In my project i insert the following line in a button's onClickListener:

memTrackerTest = new byte[1024*1024];

memTrackerTest is a private variable of the Activity.

I would expect to see the allocation in the tracker but unfortunately it doesn't appear.
Other parts of my code, like the creation of a ProgressDialog show up fine.

Any idea why my big allocation is not displayed in the allocation tracker?

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

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

发布评论

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

评论(1

尘世孤行 2024-10-17 14:38:01

我不确定确切的问题是什么。我在不同的类中尝试了相同的代码,并且它在那里工作得很好。

I'm not sure what the exact problem was. I tried the same code in a different class and it worked fine there.

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