[Question] Any way to reduce swap usage after long uptime?
Using sysmon from openrepos, I always see an upward trend in swap usage starting from a reboot. This is normal as processes / daemons / etc startup immediately after reboot. However, I still see the upward trend for the next 48 hours. Swap usage increases until around the 48 hour mark when it hits an average peak of around 300Mb. And then it goes through peaks and troughs but has an almost flat trending line (unless I do something major like stop the Dalvik service).
RAM usage, oth, has a pretty stable usage trend (with peaks and troughs) over the same time period.
Is there a way I can flush the swap or at least see what's using it? To be fair, I do use the phone quite a bit and I use web browsing quite a bit (using a combination of browsers - Opera + Sailfish browser), plus some android apps occasionally.
After around 30 Days uptime my phone does not react on any touch input except swiping to minimize. Maybe this behaviour is coming from the swap usage, just as a consequence for completeness
NuklearFart ( 2015-03-09 11:30:06 +0200 )editIf it peaks and then levels, that is not a bad thing. Swap is a problem only if it is ontinuously moving out pages that are needed again immediately. Long-running applications may get pages swapped out, that are not needed for a long perod of time (or ever) so it is good these are swapped out. Most programs for example touch very different parts on memory on startup compared to normal operation. So eventually, the least recently used pages get out of main memory, and that means more memory for applications that actually needs it. Are you just curious, or is there some performance problem you are tracking down?
mikelima ( 2015-03-09 13:52:19 +0200 )editI was trying to track down possible sources as to why the phone jitters (quite a bit more vs the previous OS update) and if there is a way to reduce or eliminate the jitters.
droll ( 2015-03-09 14:35:34 +0200 )edityou may try to use
in a terminal window and check what happens.when you do different operations. the "si" and "so" values indicate the swap in and swap out events. "swap in" event happens also when you load a new program, but "swap out" event means the memory was full and something needed to be moved out of main memory. Tweaking the user interface to be responsive may be a challenge. Developers can try to use "mlock" to lock performance critical sections of a program to RAM, but it is kind of a black magic...
mikelima ( 2015-03-09 16:52:17 +0200 )editThank you. This works well too. In the end there may be nothing much I can do to reduce jitter :( But I'll do my investigation and see what I find.
droll ( 2015-03-10 02:02:41 +0200 )edit