When KDE Eats up the Swap
N my most powerful desktop I only have 2 gigabytes of RAM. Usually it’s fine for everything to be run simultaneously, but under certain circumstances it’s possible for the swap file to kick in and typically start to be accommodated with active processes, notably KDE applications that exist in view all the time. So I got some scripts together to clean up the swap file and move those processes back to RAM, which makes them quicker (no need for disk I/O).
I have identified processes that typically enter the swap file first and can be restarted uncleanly without loss of data. So I got a script called clean-kde.sh , in which I put:
killall plasma-desktop krunner kmix
kxkb klauncher klipper && plasma-desktop &&
krunner && kmix && klipper && kxkb
&& ~/getswap-sorted.sh
That last one helps show me what other applications have data that still sits in the swap file.
getswap-sorted.sh just has
./getswap.sh | sort -n -k 5
This, in turn, is just a script I found elsewhere. getswap.sh goes as follows
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
do
let SUM=$SUM+$SWAP
done
echo "PID=$PID - Swap used: $SUM - ($PROGNAME )"
let OVERALL=$OVERALL+$SUM
SUM=0
done
echo "Overall swap used: $OVERALL"
That’s about it. The list of swap hoarders helps guide manual restarting of applications that got stuck in the swap file. It’s often worth doing this, even it it takes a couple of minutes. The desktop can stay snappy for months (without a restart of KDE or Linux).






Filed under: 

isual identity is associated with one’s mental abstraction of a concept, a person, a place, and so on. Universities use that a lot to get across their reputation, be it with a logo, a name, or some imagery of a famous site or scientist (maybe a poet). But visual identity can also aid orientation — for we all judge something that we see based on prior sights of the same (or similar) thing. This blog has had pretty much the same theme which I tailored back in 2004. Techrights has had pretty much the same design since its inception in 2006. This has little to do with convenience and more to do with how people remember those sites. Too frequent an alternation of a site’s theme (as most sites tend to do) lead to a certain disconnect and a plurality which does not help. Some things need not vary too often.
N THIS weird age when corporations are assumed to have the rights of individuals (e.g. privacy) while evading the liabilities and burdens of individuals (e.g. tax, which they can evade using loopholes) it makes one wonder what became of so-called democracy and capitalism. This was not the vision people had after they had laid the foundations for what they considered to be a humane system. Nowadays, our society is based upon ever-increasing debt and a debt that our descendants are expected to pay back. It’s a society where corporations (and their owners) gain vast amounts of money at the expense of real people and when things go awry, corporations will get bailed out and in some cases left alone when they hurt people (e.g. BP in the gulf). There is a massive looting — “piracy” one might say — going on all the time. All the power and welth gets passed to corporations, which now control the political systems too.
unning is not easy for someone my weight, but there are ways to be both strong and lightweight. When I was a teenager I used to practice at the athletic tracks and ensure that I could combine the best of both worlds — to to speak — by keeping both the upper body and lower body in good shape. The whole situation is tricky for many reasons because with an upper body too strong there is a lot more left for the legs to carry and with excessive leg exercise the upper body cannot tap into the building blocks of the body so well, not to mention the effects of exhaustion from endurance/cardio-vascular exercise (it prevents one from reaching peak performance in weight-lifting). I never managed to find good balance between those two things and there is probably no such thing as “balance” there because by improving in one area, one gets worse at the other, not just by neglect.
IFE after 30 and a life after a doctorate degree is a tad mysterious. No longer is there the feeling of growing more mature and getting in better shape. No longer is there an aspiration to advance intellectually or academically (full professorship can be take many years to earn compared to a doctorate), so what it all comes down to is what good men (and women) sometimes refer to as “settling down”, reassuring themselves that whatever has been achieved can be looked backed at with foresight involving future generations.

S SOMEONE who has worked from home since 2006 I can gladly say that motor vehicles are possible to avoid for those who wish to and whose work is location-independent. Spare office space too can be discarded. Both removals would be beneficial to the environment and reduce the impact of overpopulation.