Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running Ubuntu 12.04 on a Lenovo W500 (Core2Duo T9400, 4GB Ram)

Current kernel: 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux -- but the problems exists since a couple of months, surviving quite a few software (includig kernel) updates

I regularly put my machine into suspend-to-ram (S3) and when the machine comes back up Ubuntu starts to swap out processes. I was able to observe that the used swap-space starts to grow right after the box returns. See munin graphs below, the gap (obviously) shows the timeframe in STR.

Memory usage by day

Swap in/out by day

Needless to say that the box becomes unusable while swapping, load goes up beyond 10.

What I've done so far:

  • lowered swappiness from default (60) to 10 (via /etc/sysctl.conf: vm.swappiness=10) -- this has improved the situation much, but sometimes the problem comes back, I have not found a trigger (like memory usage) for this for now
  • lowered swappiness to 5 -- perhaps this has brought an improvement again

Before going to STR the box ran stable without (swapping) problems for hours. Today when the issue showed up again I used this script (-> http://stackoverflow.com/questions/479953/how-to-find-out-which-processes-are-swapping-in-linux) to find what processes have the most used swap space. The result after the swap orgy is like that (all PIDs with more than 10M usage):

Overall swap used: 2121344 kB
========================================
kB  pid name
========================================
439520  17491   java
208148  22719   firefox
136640  4337    /usr/bin/quodli
120852  5271    chrome
81832   5264    chrome
74284   17003   chrome
65368   16960   chrome
57088   3675    chrome
56184   30923   chrome
54412   11331   chrome
54264   3878    chrome
51508   18382   chrome
50088   3163    zeitgeist-fts
49772   15543   chrome
41344   15355   compiz
35040   1161    mysqld
32124   18374   chrome
30940   11339   chrome
30044   5752    chrome
28780   4235    plugin-containe
24576   31246   empathy-chat
23840   17703   chrome
22512   3207    ubuntuone-syncd
21588   1937    ntop
18336   2021    asterisk
17200   3915    chrome
13964   1935    Xorg
12036   10679   chrome
11104   30782   empathy
11056   2889    python
10932   16565   knotify4

The java instance at the top is IntelliJ. IntelliJ, Firefox and Chrome also were all used right before the box was put to STR.

So my question is: can I somehow prevent these swapouts AND why do they happen? Is it perhaps related to some misidentification of idle processes?

I'm not looking for resolutions like:

  • turn off swap
  • buy more RAM

Thanks in advance!

EDIT: Further progression of memory usage, same day, broadly using the same apps all the time:

enter image description here

EDIT2 (resolved): I disabled my discrete ATI card in the evening of Nov. 20th and rebooted. The swap usage then dropped (see the missing red area in the Munin graph) and did not reappear since then while the box did a couple of suspend/fully-on-cycles.

enter image description here

The root cause seems to be AMD's ATI fglrx driver (Catalyst) for radeon (Radeon Mobility HD 3650 in my case).

share|improve this question
    
What program did you use to make those graphs? They are extremely useful. –  hexafraction Nov 4 '12 at 19:10
1  
@ObsessiveSSOℲ: this is Munin (munin-monitoring.org). In order to use it with Debian/Ubuntu apt-get install munin munin-node. munin-node is the package that actually collects the data, and munin is a "server application" that can collect data of multiple nodes. The simplest setup: only from localhost. Ubuntu places the outcome in /var/cache/munin/www/. –  mdo Nov 4 '12 at 19:33
    
Good puzzle. I wonder if there's a way to audit the values of distress and mapped_ratio. –  ændrük Nov 9 '12 at 22:45
    
@ændrük: I looked at the topic you linked but found no way to monitor these values so far. However I now tried a shot into the dark and changed vm.overcommit_memory from the default 0 to 2. Restarting the IDE after that resulted in committed memory jumping up to above 7 GB. I'm looking at the behaviour for the next few days since the swap orgy does not happen on every standby-poweron-cycle. Thanks for your input. –  mdo Nov 13 '12 at 7:40

2 Answers 2

up vote 2 down vote accepted

I suspect that your Lenevo uses an ATI graphics card. Although I am not certain that it is the graphics card that is causing your problem, the following may be useful reading in order of listing.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/391628

Unity does not start after installing the fglrx drivers on 12.10

I hope this goes some way in assisting you. At your own risk.

share|improve this answer
    
ATI is correct, will check this in the next few days. –  mdo Nov 20 '12 at 9:20
    
Probably this was the root cause. I disabled the discrete ATI card via BIOS and am now running on the integrated Intel chipset, albeit with reduced eye-candy due to missing glx support. The swap-out did not happen for a few days now. I installed the latest ATI driver a few months ago (did run Intel before), downloaded it directly from AMD. –  mdo Nov 24 '12 at 7:25

There must be some processes that you must be unaware of , Happens in Windows but Task Manager in Windows shouws you percentage and all your processes , Not sure about Linux , Look for a sort of "Task Manager" with percentage and then even look for all the processes and check if it gives information of what they do , So you can track the source , I hope you fix your problem

share|improve this answer
2  
Sorry Terzuz, but that's no answer at all. If you read carefully you will recognize that it's all about used swap. And the processes that use swap space were identified. The question is why sometimes these massive swapouts happen. –  mdo Nov 13 '12 at 8:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.