android – 如何找到创建字节数组的源代码

android – 如何找到创建字节数组的源代码,第1张

概述使用DDMS并创建HPROF我可以在我的应用程序中看到数据的“直方图”视图,并注意到过多的非常大的“byte []”对象.我怀疑这是我的代码中的错误或其他愚蠢的结果.但我不知道如何查看这些字节对象的名称或查看源代码中创建它们的位置.可以这样做吗? 看看这里: DDMS Object Allocation Tracking 它逐步指定如何跟踪对象分配并找到对其负责的代码行. Tracking mem 使用DDMS并创建HPROF我可以在我的应用程序中看到数据的“直方图”视图,并注意到过多的非常大的“byte []”对象.我怀疑这是我的代码中的错误或其他愚蠢的结果.但我不知道如何查看这些字节对象的名称或查看源代码中创建它们的位置.可以这样做吗?解决方法 看看这里: DDMS Object Allocation Tracking
它逐步指定如何跟踪对象分配并找到对其负责的代码行.

Tracking memory allocation of objects

DDMS provIDes a feature to track objects that are being allocated to memory and to see which classes and threads are allocating the objects. This allows you to track,in real time,where objects are being allocated when you perform certain actions in your application. This information is valuable for assessing memory usage that can affect application performance.

To track memory allocation of objects:

In the Devices tab,select the process that you want to enable allocation tracking for.

In the Allocation Tracker tab,click the Start Tracking button to begin allocation tracking. At this point,anything you do in your application will be tracked.

Click Get Allocations to see a List of objects that have been allocated since you clicked on the Start Tracking button. You can click on Get Allocations again to append to the List new objects that that have been allocated.

To stop tracking or to clear the data and start over,click the Stop Tracking button. Click on a specific row in the List to see more detailed information such as the method and line number of the code that allocated the object.
总结

以上是内存溢出为你收集整理的android – 如何找到创建字节数组的源代码全部内容,希望文章能够帮你解决android – 如何找到创建字节数组的源代码所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1127408.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存