We have moved to a new Sailfish OS Forum. Please start new discussions there.
3

[bug?] kswapd0 running with high cpu load for extended time period [answered]

asked 2014-12-19 03:07:37 +0300

droll gravatar image

as the title says. I am running lighthouse from openrepos and I can see kswapd0 running with average of 49% to 50% CPU load for extended time periods (running for 2 minutes and till not letting up). my phone is connected to the charger at the moment. UI is still responsive, however.

I tried stopping dalvik. after about 30 seconds of this, kswapd0 utilization returns to normal.

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by droll
close date 2014-12-19 12:38:52.144361

Comments

what is the sailfish os version you are running at on your device?

tigeli ( 2014-12-19 09:10:15 +0300 )edit

Update 11.

droll ( 2014-12-19 10:07:49 +0300 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2014-12-19 09:19:29 +0300

tbr gravatar image

kswapd0 is the Linux Kernel process responsible for memory management and in particular also swap.

As you explicitly mention running AlienDalvik, I believe the answer to be pretty simple:

  • AlienDalvik is a known memory hog, in combination with android apps
  • If you have anything else running, or just many Android apps, then you will exhaust the free memory
  • At a certain point of very low memory the Linux Kernel (in the form of kswapd) will start frantically trying to free up and rearrange memory to squeeze out the last possible bits. Eventually it will even resort to killing applications to keep the system operational, cf. OOMkiller.

Further reading on kswapd

tl;dr - it's expected, AlienDalvik needs a lot of memory, the Jolla phone doesn't have much, things go bad.

edit flag offensive delete publish link more

Comments

yeah, I understand what kswapd is doing. just that I've never seen it behave this way prior to Update 11. so I wasn't entirely sure if this is a bug either (hence the title of [bug?]).

so I expect this to be normal then?

droll ( 2014-12-19 10:08:21 +0300 )edit

You didn't mention your OS version, you got a generic answer. In U11 there were indeed quite some changes to memory setup - if you read the change log. Crying Wolf/Bug immediately, without deeper inspection is a bit premature in my opinion. I've had it plenty of times that Android apps in collaboration with aliendalvik would gobble up my RAM and the phone would become unusable, also before U11 - kswapd was spinning like mad back then too.

tbr ( 2014-12-19 10:16:30 +0300 )edit

Either update 9 or 10 also added zram compressed swap, so lots of swap activity means also at least bit larger cpu usage. But ~50% sounds suspicious as that would mean one of the cores at 100%.

DeeGee ( 2014-12-19 10:18:00 +0300 )edit

hmmmmmmmm....i saw this behaviour again and yes one of the cores was at 100%. this time i didn't kill aliendalvik. i just removed all running apps from the home screen except for lighthouse. after a while, kswapd went back to normal again (about 2 minutes).

i can live with this for now since it isn't rendering the phone unusable but i didn't expect the process to run for so long.

ok, i'll close this for now and do more testing / observation. if it does become a big problem, i'll reopen this.

thanks all.

droll ( 2014-12-19 12:38:23 +0300 )edit

Question tools

Follow
3 followers

Stats

Asked: 2014-12-19 03:07:37 +0300

Seen: 1,698 times

Last updated: Dec 19 '14