View previous topic :: View next topic |
Author |
Message |
XiaoaiX n00b
Joined: 30 May 2015 Posts: 30
|
Posted: Wed Aug 19, 2015 5:41 am Post subject: Kswapd0 consume most CPU |
|
|
I am using kernel 4.05. I always keep open some pdf files (about 10) with okular and a lot of webpages in firefox. From time to time, the system become very slow. top shows that kswapd0 consumes 100% CPU and changes slowly down. After a while, always if it is lucky, the kswapd0 disappears and the system come back to usual. But in seldom cases, the system will not response if I just open some resource consuming webpage in firefox, and I have to reboot.
My system have 8G memory, 512G SSD. No swap is on.
Can I avoid such things happening without closing those pdf files and webpages?
Or can I find out which process consumes the memory most?
Thanks |
|
Back to top |
|
|
ct85711 Veteran
Joined: 27 Sep 2005 Posts: 1791
|
Posted: Wed Aug 19, 2015 3:13 pm Post subject: |
|
|
well, it's sounds like you are eating away all of your memory doing all that (specially on only 8GB without swap). The common trend I was seeing for this, is just about the same you was doing, about 8GB of ram and no swap, interestingly enough, the easy fix was adding a swap file (kswapd stopped hogging the CPU)...
Well, best bet to check on memory usage would be firefox (always a hog), though on my system I have one pdf file that makes firefox's worse memory usage look like child's play (in ocular, it usually filled over 12GB of ram easily by it's self).
The 2 prime things to check, is good old top and free -m |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Wed Aug 19, 2015 4:42 pm Post subject: |
|
|
Just to add a recommendation for sys-process/htop.
Really nice, and allows you to view by-thread, if required. |
|
Back to top |
|
|
Princess Nell l33t
Joined: 15 Apr 2005 Posts: 916
|
Posted: Wed Aug 19, 2015 10:14 pm Post subject: |
|
|
Sounds like a desktop machine. I have seen kswapd problems only on servers, and most likely along the lines of https://www.centos.org/forums/viewtopic.php?t=29411 (last posting in thread): free memory imbalance on systems with NUMA enabled. |
|
Back to top |
|
|
Buffoon Veteran
Joined: 17 Jun 2015 Posts: 1369 Location: EU or US
|
Posted: Wed Aug 19, 2015 11:46 pm Post subject: |
|
|
Have you adjusted swappiness in sysctl.conf. _________________ Life is a tragedy for those who feel and a comedy for those who think. |
|
Back to top |
|
|
XiaoaiX n00b
Joined: 30 May 2015 Posts: 30
|
Posted: Mon Aug 24, 2015 10:13 am Post subject: |
|
|
Buffoon wrote: | Have you adjusted swappiness in sysctl.conf. |
haven't done any thing in sysctl.conf. I don't know what swappiness in sysctl.conf means? Could you explain more? |
|
Back to top |
|
|
XiaoaiX n00b
Joined: 30 May 2015 Posts: 30
|
Posted: Mon Aug 24, 2015 10:17 am Post subject: |
|
|
So, it seems that okular is not good at managing memory. I would change to acroread now.
ct85711 wrote: | well, it's sounds like you are eating away all of your memory doing all that (specially on only 8GB without swap). The common trend I was seeing for this, is just about the same you was doing, about 8GB of ram and no swap, interestingly enough, the easy fix was adding a swap file (kswapd stopped hogging the CPU)...
Well, best bet to check on memory usage would be firefox (always a hog), though on my system I have one pdf file that makes firefox's worse memory usage look like child's play (in ocular, it usually filled over 12GB of ram easily by it's self).
The 2 prime things to check, is good old top and free -m |
|
|
Back to top |
|
|
XiaoaiX n00b
Joined: 30 May 2015 Posts: 30
|
Posted: Mon Aug 24, 2015 11:13 am Post subject: |
|
|
But why should kswapd0 use up all the cpu but not share with others? This seem to be a bug. In my opinion, a good way to do this is when the memory is used to about 90% and this kswapd0 be called to clear the memory. It then can share the cpu with others because the others can use the 10% left without waiting for kswapd0. Why not do like this? |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Mon Aug 24, 2015 12:05 pm Post subject: |
|
|
XiaoaiX wrote: | haven't done any thing in sysctl.conf. I don't know what swappiness in sysctl.conf means? Could you explain more? |
See this tip |
|
Back to top |
|
|
ct85711 Veteran
Joined: 27 Sep 2005 Posts: 1791
|
Posted: Mon Aug 24, 2015 2:11 pm Post subject: |
|
|
Quote: | But why should kswapd0 use up all the cpu but not share with others? This seem to be a bug. In my opinion, a good way to do this is when the memory is used to about 90% and this kswapd0 be called to clear the memory. It then can share the cpu with others because the others can use the 10% left without waiting for kswapd0. Why not do like this? |
The issue with that, isn't the CPU usage, it's more of kswapd0 isn't finding any memory to clear out, so other stuff can start up/run. Trying to put more water in a tank that is already full does not work out, regardless of all the pushing you are doing. As it is, your getting close to triggering the kernel's memory killer to forcibly clear out memory (by killing running programs).
I'm not sure how changing the swappiness is going to do anything, when the OP even stated there is no swap to begin with. Now, you know you can easily just put a swap file/partition on a USB drive/external drive. |
|
Back to top |
|
|
Buffoon Veteran
Joined: 17 Jun 2015 Posts: 1369 Location: EU or US
|
Posted: Mon Aug 24, 2015 2:55 pm Post subject: |
|
|
ct85711
what you said makes sense. I didn't read the OP thoroughly.
XiaoaiX
there is a known memory leak in QT 4.8.7, I know it because I had QT installed for MythTV and it just ate up all my RAM, downgraded to 4.8.6 and the problem went away. |
|
Back to top |
|
|
XiaoaiX n00b
Joined: 30 May 2015 Posts: 30
|
Posted: Tue Aug 25, 2015 1:27 am Post subject: |
|
|
Buffoon wrote: | ct85711
what you said makes sense. I didn't read the OP thoroughly.
XiaoaiX
there is a known memory leak in QT 4.8.7, I know it because I had QT installed for MythTV and it just ate up all my RAM, downgraded to 4.8.6 and the problem went away. |
I am using QT 4.8.6-r2 not QT 4.8.7. |
|
Back to top |
|
|
|