flutter_shimmer icon indicating copy to clipboard operation
flutter_shimmer copied to clipboard

Extremely high CPU usage causing phone to overheat

Open l0rinc opened this issue 2 years ago • 14 comments
trafficstars

It seems that shimmering causes a ~40-60% CPU usage when running:

It's so severe that my phone overheats.

If I give it a stopping condition (i.e. loop: 2), it's reduced considerably:

l0rinc avatar Feb 03 '23 11:02 l0rinc

"Use one [Shimmer] to wrap a list of [Widget]s instead of a list of many [Shimmer]s"

Make sure you are not having little shimmers animating themselves instead you need to have parent shimmer, applying animation over multiple containers/placeholders

dmitry-grin avatar Feb 10 '23 14:02 dmitry-grin

Even a single one was causing it - is there a busy wait underneath? A simple animation like this shouldn't cause the overheating. If there is, maybe even a tiny sleep (or a https://api.flutter.dev/flutter/scheduler/Ticker-class.html, maybe, not sure) could solve the warming...

l0rinc avatar Feb 10 '23 15:02 l0rinc

Hi everyone! Any updates?

reza00farjam avatar May 26 '23 15:05 reza00farjam

Interesting, I found similar spike in CPU usage. Were you able to figure out the root cause? I've incorporated @dmitry-grin's feedback but is there anything else we can do to reduce the CPU usage?

soheb12 avatar Jun 11 '23 19:06 soheb12

Same here ...

istornz avatar Jul 28 '23 06:07 istornz

Do any of you experience this overheating on Android? I'm facing the same issue but seems to be happening only on iOS. Also trying to figure out is this could be an Impeller issue.

joaopmarquesini avatar Aug 26 '23 12:08 joaopmarquesini

Same here ...

giantss avatar Sep 13 '23 11:09 giantss

Same here with shimmer: ^3.0.0

splimter avatar Nov 15 '23 18:11 splimter

this is very bad!

bahiraei avatar Nov 16 '23 17:11 bahiraei

Came across this issue after our users have reported our app is draining battery life and phone getting hot, only on iOS? Similar to @joaopmarquesini

Is there away round this or it is due to using multiple shimmers on the one view?

b099l3 avatar Mar 12 '24 10:03 b099l3

@b099l3 from what I tried, even if I used a single shimmer but had it constantly on screen (I was using it on animations for a gaming app) the phone would overheat.

joaopmarquesini avatar Mar 12 '24 11:03 joaopmarquesini

Slightly unrelated but also good to know for others. We also use Intercom in our app and this issue also mentioned high CPU load. I updated Intercom to 16.5.4 it out and it massively dropped our CPU usage 120-130% to 30-40% 🤯

BEFORE

imp-eng imp-cpu

AFTER

Screenshot 2024-03-13 at 11 06 13 Screenshot 2024-03-13 at 11 06 05

b099l3 avatar Mar 13 '24 11:03 b099l3

On my side, I have set the loop to 1 as a temporary workaround. Now the shimmer only play 1 time, I don't have any CPU issues now.

istornz avatar Mar 13 '24 15:03 istornz

Same here on Android, any updates?

imajercsik avatar Jun 11 '24 13:06 imajercsik