Android应用程序,CPU使用率过高,不服务或wakelocks [英] Android app high CPU usage, no services or wakelocks

查看:749
本文介绍了Android应用程序,CPU使用率过高,不服务或wakelocks的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我分支的系统消息应用程序,它消耗了我的大部分的CPU,和其他人的报道一致。我不能为我的生命确定原因。

I've forked the system messaging app and it is consuming the majority of my CPU, and others have reported the same. I cannot for the life of me determine why.

我想通排水可能是可能两件事情(因为它是多么的排水):尚未发布的激活锁定,或服务做连续计算

I figured the drainage could be possibly two things (because of how much it is draining): a wakelock that has not been released, or a service doing continuous computation.

下面是我曾尝试:

亚行外壳dumpsys功率

这显示唤醒锁:大小= 0 所以我假设它不是一个激活锁定的问题(应用程序使用wakelocks,当然,但我还没有触及$ C $ç涉及它们)。我也有使用的应用程序,激活锁定探测器,这也说明了我的申请没有唤醒锁定。

This shows Wake Locks: size=0 so I am assuming it is not a wakelock issue (the app uses wakelocks, of course, but I have not touched the code involving them). I have also used the app, WakeLock Detector, which also shows no wake locks for my application.

我已经搜索日志不知疲倦地指示无济于事问题的东西。我还检查正在运行的服务(通过设置>应用>运行),有对应用程序运行的任何服务。

I have searched the logs tirelessly for something indicating a problem to no avail. I have also checked running services (via Settings > Apps > Running) and there are no services running for the app.

有谁知道什么可能会造成这个(巨大)电池耗尽?

Does anyone know what may be causing this (enormous) battery drain?

编辑:我下载了所谓的禁用服务的应用程序,让我来查看所有服务的应用程序有可用。与我的问题的主要问题是它是不可能复制的(也就是说,我不知道如何复制它,它似乎随机发生的)。我设法今天遇到的电池消耗,并试图禁用服务(TransactionService对于那些有兴趣),问题立即停止。我不认为我可以肯定地说,这个服务是造成问题,但它是看的第一个地方。在code是可用的<一个href=\"https://bitbucket.org/cyanogenmod/android_packages_apps_mms/src/f7e8281a223af6228e6399055a6197a1edd9bc3a/src/com/android/mms/transaction/TransactionService.java\"相对=nofollow>这里。

I downloaded an app called "Disable Service" that allows me to view all services an app has available. The main issue with my problem is it is impossible to replicate (that is, I don't know how to replicate it and it seems to happen randomly). I managed to encounter the battery drain today and tried disabling a service (TransactionService for those interested) and the problem stopped immediately. I don't think I can say for sure that this service is causing the problem but it is the first place to look. The code is available here.

推荐答案

不知道什么都造成了这一问题。开始与不同的叉子不同的AOSP科大厦,也没有再见过了。

Not sure what ever caused this problem. Started building with a different AOSP branch with a different fork and haven't seen it again.

这篇关于Android应用程序,CPU使用率过高,不服务或wakelocks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆