-1

There is an application that every day creates about 100-200 new wakelocks for android. each wakelock is used once and after using it is no longer needed, but remains in the system. Thus there are a lot of unused wakelocks in the system. How do you think this is correct? or is it bad for system performance?

if you are wondering what kind of application it is and how this is possible, then see the link: https://github.com/iNPUTmice/Conversations/issues/4012

Filin
  • 1
  • 1

1 Answers1

0

Is it bad for system performance?

In terms of compute, probably no real effect since the app completes its work and yields. Especially if the app is in foreground during this time, and the work is relatively quick (roughly <1 min or so)

In terms of battery use, questionable. If its the highest wakelock level (screen + CPU), when the user turns off the screen, they are released. If its just the CPU wakelock, then they'll hang around and keep draining battery. Though later android versions and OEM optimizations may just remove wake locks after some time.

Is it bad practice? YES!

This undoubtedly drain power more than it should and gives the system the impression the app needs to keep either the CPU running for longer than required influencing OS incorrectly.

Also note that this is a generic question rather than a specific issue, so you may get a better answer from https://softwareengineering.stackexchange.com/

Madushan
  • 6,977
  • 31
  • 79