Android studio 性能调试

  1. **线程活动时间线:**列出属于您的应用程序进程的每个线程,并使用下面列出的颜色沿着时间线指示其活动。记录跟踪后,您可以从此时间线中选择一个线程,以在跟踪窗格中检查其数据。
  • **绿色:**线程处于活动状态或准备好使用 CPU。也就是说,它处于正在运行或可运行状态。
  • **黄色:**线程处于活动状态,但正在等待 I/O 操作(例如磁盘或网络 I/O),然后才能完成其工作。
  • **灰色:**线程正在休眠,不消耗任何 CPU 时间。当线程需要访问尚不可用的资源时,有时会发生这种情况。线程要么进入自愿睡眠状态,要么内核将线程置于睡眠状态,直到所需的资源可用。CPU Profiler 还报告 Android Studio 和 Android 平台添加到应用程序进程中的线程的 CPU 使用情况,例如JDWPProfile SaverStudio:VMStatsStudio:PerfaStudio:Heartbeat(尽管线程活动时间线中显示的确切名称可能有所不同)。Android Studio 会报告此数据,以便您可以确定线程活动和 CPU 使用率实际上是由应用代码引起的。

**三、**Android studio Memory调试

选择监测memory:

官网说明:

  • Java: Memory from objects allocated from Java or Kotlin code.
  • Native: Memory from objects allocated from C or C++ code.

Even if you're not using C++ in your app, you might see some native memory used here because the Android framework uses native memory to handle various tasks on your behalf, such as when handling image assets and other graphics---even though the code you've written is in Java or Kotlin.

  • Graphics: Memory used for graphics buffer queues to display pixels to the screen, including GL surfaces, GL textures, and so on. (Note that this is memory shared with the CPU, not dedicated GPU memory.)
  • Stack: Memory used by both native and Java stacks in your app. This usually relates to how many threads your app is running.
  • Code: Memory that your app uses for code and resources, such as dex bytecode, optimized or compiled dex code, .so libraries, and fonts.
  • Others: Memory used by your app that the system isn't sure how to categorize.
  • Allocated: The number of Java/Kotlin objects allocated by your app. This does not count objects allocated in C or C++.

When connected to a device running Android 7.1 and lower, this allocation count starts only at the time the Memory Profiler connected to your running app. So any objects allocated before you start profiling are not accounted for. However, Android 8.0 and higher includes an on-device profiling tool that keeps track of all allocations, so this number always represents the total number of Java objects outstanding in your app on

四、Android studio logcat调试

点击如下红框进行logcat调试:

过滤条件:

//输入package:(输入一个p就会有提示的) ,+ 你的包名 package:com.test.test

// 输入level: ,后面加上等级,如info,debug,warning等 // 当等级为Info时,过滤Info及以上的日志 level:debug

// 输入tag: ,后面跟上你要过滤的TAG,此功能同老版本的AS tag:TAG

// 输入message: +过滤的关键字 message:KW

详细可 参考官网:

最后

我一直以来都有整理练习大厂面试题的习惯,有随时跳出舒服圈的准备,也许求职者已经很满意现在的工作,薪酬,觉得习惯而且安逸。

不过如果公司突然倒闭,或者部门被裁减,还能找到这样或者更好的工作吗?

我建议各位,多刷刷面试题,知道最新的技术,每三个月可以去面试一两家公司,因为你已经有不错的工作了,所以可以带着轻松的心态去面试,同时也可以增加面试的经验。

我可以将最近整理的一线互联网公司面试真题+解析分享给大家,大概花了三个月的时间整理2246页,帮助大家学习进步。

由于篇幅限制,文档的详解资料太全面,细节内容太多,所以只把部分知识点截图出来粗略的介绍,每个小节点里面都有更细化的内容!以下是部分内容截图:

加入社区》https://bbs.csdn.net/forums/4304bb5a486d4c3ab8389e65ecb71ac0

1725642325874)]

加入社区》https://bbs.csdn.net/forums/4304bb5a486d4c3ab8389e65ecb71ac0

相关推荐
AAD555888996 小时前
数字仪表LCD显示识别与读数:数字0-9、小数点及单位kwh检测识别实战
python
开源技术8 小时前
Python Pillow 优化,打开和保存速度最快提高14倍
开发语言·python·pillow
Li emily9 小时前
解决港股实时行情数据 API 接入难题
人工智能·python·fastapi
wfeqhfxz25887829 小时前
农田杂草检测与识别系统基于YOLO11实现六种杂草自动识别_1
python
mftang10 小时前
Python 字符串拼接成字节详解
开发语言·python
0思必得010 小时前
[Web自动化] Selenium设置相关执行文件路径
前端·爬虫·python·selenium·自动化
石去皿10 小时前
大模型面试通关指南:28道高频考题深度解析与实战要点
人工智能·python·面试·职场和发展
jasligea10 小时前
构建个人智能助手
开发语言·python·自然语言处理
测试秃头怪10 小时前
面试大厂就靠这份软件测试八股文了【含答案】
自动化测试·软件测试·python·功能测试·面试·职场和发展·单元测试
测试杂货铺10 小时前
软件测试面试题大全,你要的都在这。。
自动化测试·软件测试·python·功能测试·面试·职场和发展·测试用例