# Android CPU usage 100% when switching network types



## gmarch (Dec 21, 2011)

I've been observing a particular behavior on my Razr that I've tried to narrow down. Without getting into the actual code, I've reached my limit as to what I can do, and thought I would see if anyone has any suggestions, or thoughts. To be honest, I think this is a fundamental flaw in the code that manages network switching, plus an issue with how Verizon or the actual protocol handle the switching.

I'm running the stock Verizon ROM (98.72.16.XT912.Verizon.en.US - Android 4.1.2) on my Razr, and I happen to work in an area that has very poor cell service. I also run "Usage Timelines Pro", a CPU load meter that runs in the notification bar.

I am relatively technical, (although, it's been a few years since I've written a device driver.  ), so I am approaching the problem from a software engineering perspective.

Here's what's happening:

My phone is constantly switching between 4G, 3G, and 1xRTT
When it switches, my network icon goes from blue to white until it re-registers with Verizon (I think that's what's going on)
If the switch is "fast", the operation is fairly seamless.
If the switch has a problem, like low signal strength, I will sometimes loose the data connection.
When the data connection is lost, and then reacquired, my CPU shows 100% load (i.e., both cores maxed out).

This load persists anywhere from 5 seconds to a minute or more.

It is very difficult to look at the processes that are running when it is in this state, but what I've observed is that "Android System" is the primary process consuming CPU. It does also look like other applications are trying to get resources as well (Calendar Storage, Facebook, etc.).

I suspect that 1) Android is not handling the loss of a data connection well and 2) applications are triggered by a connectivity manager event to refresh themselves.

The combination of "Android System" consuming CPU, poor signal, and several applications attempting to "phone home" totally overwhelms the phone. Not to mention that I can fry an egg on the back of the thing...

So, I don't have a solution, but I'm hoping that someone out here does...

Thanks!

/greg


----------

