kswapd0 sucking up CPU

Search This thread

notverycreative

Senior Member
Oct 31, 2010
294
48
/dev/null
Just as it looks like. I have a Samsung Vibrant with Nero 2.2. Watchdog reports kswapd0 routinely sucking 50% or more of my CPU with both the kernel Nero comes with and Voodoo. What would cause this and how can I fix it?

Sent from my SGH-T959 using XDA App
 
  • Like
Reactions: endolith

jonwilly

Senior Member
Aug 22, 2010
84
2
Would love to see a response to this as I am having the same issue. Its eating up battery life.
 

Saiboogu

Senior Member
Apr 28, 2009
305
5
Frostburg MD
I also had this - huge slowdowns, phone always hot, plenty of Watchdog alerts. Few different kernels, don't recall all that I tried. I can tell you that it doesn't happen anymore on Blackhole 1.1 w/ JK6 modem and "Eugene's B series #20 kernel." I haven't been keeping up lately, that's quoted straight from ROM Manager.
 

boarder.2k9

Senior Member
Dec 17, 2010
288
67
I am having the same problem. I read that it is to do with the Linux base which voodoo uses. I am using voodoo kernel but not really sure how to go about replacing it with something as good but without this battery raping problem.
 

Kagoshema

Senior Member
Jul 17, 2010
129
1
I am having the same problem. I read that it is to do with the Linux base which voodoo uses. I am using voodoo kernel but not really sure how to go about replacing it with something as good but without this battery raping problem.

having the same problem with Darky rom on the Captivate and speedmod kernel

is this process just present in all ext4 enabled kernels?
 

xriderx66

Senior Member
Oct 10, 2010
6,473
1,501
Frisco, TX
having the same problem with Darky rom on the Captivate and speedmod kernel

is this process just present in all ext4 enabled kernels?

it may be present, but on my voodoo its doing nothing more than what it should.
theres nothing thats making any service act up, it might be the kernel.
change to voodoo, its da best.
 

v1nsai

Senior Member
May 15, 2010
139
9
OnePlus 6T
Google Pixel 3a XL
I'm on a captivate using a voodoo kernel having the same problems, this definitely seems to be a galaxy s problem. I'm read that changing the kernel paging size with the touch command to 10 instead of default 100 can help prevent this, I saw that solution on a centos forum though so it may or may not apply to android. I might try it out later after I take a backup. this post might be talking about the same thing, though the poster claims to not be a kernel hacker /shrug

EDIT:
Tried "busybox sysctl -w vm.dirty_ratio=10" and didn't see a difference. Then I set it to 5 and rebooted and swapd0 hasn't gotten higher than like 5%. I still see it somewhat often but never too high. Maybe setting it to 10 would keep it from coming up so often but so far I'm happy :-D

Re-EDIT:
Took a few hours but eventually want back to constantly seeing kswapd0 again. I flashed a few rom and only my most needed apps and of course a theme and haven't seen it all day. Was worried it might be my theme (crysis revolution is worth the hassle it's amazing) but seems I got a rogue app somewhere. Gonna slowly install more apps every day and see if it comes up again.

Later....
Anyone else using QuickDesk? That's what was doing it for me. Installed it and kswap started acting up. Removed it and haven't gotten a single alert about it all day.
 
Last edited:
  • Like
Reactions: ^I'm_With_Stupid

Boggy22

Senior Member
Dec 7, 2010
81
6
Hi guys,

I'm struggling with this problem too. I had it on Froyo 2.2, with Z4Mod or OCLF V2.2. Then I upgraded to 2.3.4 and flashed speedmod k15h.

The damned kswapd0 process still acts up, but I think I figured out the cause(don't have a fix yet, maybe someone who knows linux better can help us).

kswapd0 acts by transferring data from RAM to the SD Card when there's low memory. For example on my I9000, it starts doing that when things go under 10-8 mB of free RAM(Actual RAM, please install Galaxy Tuner and go to Memory Management to see the real figures divided by MemFree/Buffers/Cached).

For example, I had ~6500kb MemFree, then the CPU got to 100%; of course, kswapd0 worked it's "magic", and when it finished the MemFree got to ~26.000 kB.

Also, kswapd0 ceases to use the CPU if you Flush File Cache. So this is a memory handling problem.

I'll try to find a setting inside Galaxy Tuner to see if this solves the problem.

BTW, could Saiboogu, or anyone who had this problem give us the memory handling parameters they have now on their ROMs? We would need the File Cache control settings(SWP/VCP/DEC/DWC/DRA/DBR), and the Application Cache settings too(FA/VA/SS/HA/CP/EA). Maybe this will fix it, because I have no other explanation(and hope) right now.

Don't be afraid to chip in your oppinions, let's find a solution to this sucker(literally). :)
 
Last edited:

Woody

Retired Admin - Vacationing in Nanda Parbat
Nov 18, 2010
8,842
16,519
Immersed in Dark Matter
Are your Rooted? Probably so if you have OCLF installed. My bad. Ok download any terminal from the market and run these commands:

SU (hit enter and a SU permission will pop up-hit yes)
The $ will change to a #, then type

Busybox df -h (with a space between x and d and F and -)

I'd like to know that the read out says.

If it says what I think it will, then I might have a cause of the issue. Maybe not a solution but I am pretty sure I know what it is.
 

Boggy22

Senior Member
Dec 7, 2010
81
6
Who, me? I don't have OCLF, I'm running Gingerbread 2.3.4 XXJVQ + Speedmod Kernel.

Do you still want me to run the terminal command and let you know the response?
 

Woody

Retired Admin - Vacationing in Nanda Parbat
Nov 18, 2010
8,842
16,519
Immersed in Dark Matter
Yes you and sorry about that. I missed the "HAD" part of the sentence. The point really is are you rooted and can you please run the terminal commands and post them?
 

Boggy22

Senior Member
Dec 7, 2010
81
6
Yes, 233 files in the xbin folder.

Also, if I go into BusyBox, it says: Installed version 1.19.3.

And if I click install it says: BusyBox found (/system/xbin).

L.E. I reinstalled Busybox and it works, give me a sec to post it here.

L.L.E. - Here it is:
 

Attachments

  • shot_000007.jpg
    shot_000007.jpg
    35.7 KB · Views: 426
Last edited:

Woody

Retired Admin - Vacationing in Nanda Parbat
Nov 18, 2010
8,842
16,519
Immersed in Dark Matter
Ok then try it again
Open terminal and pull up your keyboard.

Type SU [enter]
then type busybox df -h [enter]


This will show how every piece of your phone is partitioned. kswapd0 is nothing more than a Swap file. Think of it as a holding zone for apps that you have running. Like this. You are in the XDA app and looking at things. Then you come across a file that has a link on it. You click on the link and it pulls up an address in your Browser. While the Browser is running, the XDA app is kicked to a SWAP partition so that it doesn't have to be restarted when you click out of the Browser, just "reinitiated" so to say.

Some ROMs/Kernels use SWAP, although most don't b/c Andorid does a pretty good job of task managment on its own. In the old days before you had 2.2, you could not move apps to your SD card without partitioning your SD card and using some ADB scripts to force install them on your SD-EXT partition. Your, say 8gb, SD card would look like this FAT 7gb, SD-ext600mb/ swap120mb. What would happen is that your apps would download from the market right into you SD-Ext partition and you would have nearly full internal memory b/c well nothing but /cache was taking space. Swap would help the app launching process and also task management.

So you say, why the heck is he telling me all this for? Because you have a rogue app that is going into your swap partition and not coming out. It is running in there all the time. Swap is for short bursts and when you back out of say the Browser from above, it would close and your XDA app would come out of Swap and back into "active".

Find the Rogue App and you'll fix your problem.


Edit:::Ok so while I was typing that you posted your screen shot. Same from above applies. You have a rogue app that isn't shutting down. Need to find it.

Sidenote::Your /system is almost totally full. You might be needing to get rid of some bloat here pretty soon or you will find that you won't be able to install some apps from the market. Plus I bet some of that bloat is running in the background eating up RAM and battery. You'll have to search for what is and isn't safe to remove.
 
Last edited:
  • Like
Reactions: ^I'm_With_Stupid

Boggy22

Senior Member
Dec 7, 2010
81
6
So that means the Minecraft Demo and SVOX Language Pack are the rogue apps?(looking at my screenshot).

Will uninstall and Reinstall fix the problem? I don't really care about Minecraft, but I paid for Grace... Well, for her voice to be more precise. :D
 
Last edited:

Woody

Retired Admin - Vacationing in Nanda Parbat
Nov 18, 2010
8,842
16,519
Immersed in Dark Matter
Try using Titanium Backup Pro and "freeze" them before you uninstall. Bet those are the problems. Last time you played Minecraft, did you exit out of it? Bet it is still running in the back ground. Try the freeze and then see how yout CPU is working with one frozen or both.

Good luck and hit that thanks button. Kirk out!!
 
  • Like
Reactions: Boggy22

Boggy22

Senior Member
Dec 7, 2010
81
6
I uninstalled Minecraft(It doesn't show up in SU anymore). The thing is that I didn't even start it after the last reboot, so I have no clue how it got there.

I'll see if things shape up without uninstalling SVOX, then if not, I'll freeze it.

If this fixes it, you'll not only have thanks from me, but from all over the world!

Thanks! I'll let you know of the progress!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Sorry for the double post, but it's worth the thread UP and notification for those with this problem.

    SOLVED! Apparently...(still testing)

    I flashed Semaphore Kernel, and the problem is gone. After 30 minutes since boot, kswapd had 1s cpu time, instead of over 100 like before... Also, iGO MyWay runs as it should, without lag(caused by kswapd0 before too).
    2
    @riskaa - To answer your PM, it seems that Boggy was having the same problems as yourself and what we found out was that if you reflash your existing kernel (to kind of start clean so to say) or flash another kernel, the kswapd0 problem will be fixed.

    I suggest installing Watchdog to see what is eating up your RAM/CPU and probably killing your battery too.

    ************
    This is actually a great informative read if anyone wants to check it out and see how your RAM works (at least in this fashion). It is short and only 3 pages but a ton of problem solving done with a solution at the end.
    1
    Just as it looks like. I have a Samsung Vibrant with Nero 2.2. Watchdog reports kswapd0 routinely sucking 50% or more of my CPU with both the kernel Nero comes with and Voodoo. What would cause this and how can I fix it?

    Sent from my SGH-T959 using XDA App
    1
    I'm on a captivate using a voodoo kernel having the same problems, this definitely seems to be a galaxy s problem. I'm read that changing the kernel paging size with the touch command to 10 instead of default 100 can help prevent this, I saw that solution on a centos forum though so it may or may not apply to android. I might try it out later after I take a backup. this post might be talking about the same thing, though the poster claims to not be a kernel hacker /shrug

    EDIT:
    Tried "busybox sysctl -w vm.dirty_ratio=10" and didn't see a difference. Then I set it to 5 and rebooted and swapd0 hasn't gotten higher than like 5%. I still see it somewhat often but never too high. Maybe setting it to 10 would keep it from coming up so often but so far I'm happy :-D

    Re-EDIT:
    Took a few hours but eventually want back to constantly seeing kswapd0 again. I flashed a few rom and only my most needed apps and of course a theme and haven't seen it all day. Was worried it might be my theme (crysis revolution is worth the hassle it's amazing) but seems I got a rogue app somewhere. Gonna slowly install more apps every day and see if it comes up again.

    Later....
    Anyone else using QuickDesk? That's what was doing it for me. Installed it and kswap started acting up. Removed it and haven't gotten a single alert about it all day.
    1
    Ok then try it again
    Open terminal and pull up your keyboard.

    Type SU [enter]
    then type busybox df -h [enter]


    This will show how every piece of your phone is partitioned. kswapd0 is nothing more than a Swap file. Think of it as a holding zone for apps that you have running. Like this. You are in the XDA app and looking at things. Then you come across a file that has a link on it. You click on the link and it pulls up an address in your Browser. While the Browser is running, the XDA app is kicked to a SWAP partition so that it doesn't have to be restarted when you click out of the Browser, just "reinitiated" so to say.

    Some ROMs/Kernels use SWAP, although most don't b/c Andorid does a pretty good job of task managment on its own. In the old days before you had 2.2, you could not move apps to your SD card without partitioning your SD card and using some ADB scripts to force install them on your SD-EXT partition. Your, say 8gb, SD card would look like this FAT 7gb, SD-ext600mb/ swap120mb. What would happen is that your apps would download from the market right into you SD-Ext partition and you would have nearly full internal memory b/c well nothing but /cache was taking space. Swap would help the app launching process and also task management.

    So you say, why the heck is he telling me all this for? Because you have a rogue app that is going into your swap partition and not coming out. It is running in there all the time. Swap is for short bursts and when you back out of say the Browser from above, it would close and your XDA app would come out of Swap and back into "active".

    Find the Rogue App and you'll fix your problem.


    Edit:::Ok so while I was typing that you posted your screen shot. Same from above applies. You have a rogue app that isn't shutting down. Need to find it.

    Sidenote::Your /system is almost totally full. You might be needing to get rid of some bloat here pretty soon or you will find that you won't be able to install some apps from the market. Plus I bet some of that bloat is running in the background eating up RAM and battery. You'll have to search for what is and isn't safe to remove.