Android - 内存分配跟踪器未跟踪我的测试分配
我目前正在研究 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定确切的问题是什么。我在不同的类中尝试了相同的代码,并且它在那里工作得很好。
I'm not sure what the exact problem was. I tried the same code in a different class and it worked fine there.