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: 
N the middle of last year I found myself with an extra new widescreen monitor that could not be used because my graphics card only supports up to two monitors. I pondered buying a new graphics card to add a third or fourth monitor to the same box, but this turned out to be uneconomic. So instead I bought an extra box and installed Debian Squeeze on it. It would add a processor to my setup and also help stay connected when either of the machine requires downtime. Over time I learned how to properly use this “helper box”, which is connected to a separate mouse and keyboard. It is mostly used for monitoring of information that changes over time.
OZILLA is arguably responsible for restoring competition on the Web browsers front and also for ensuring that Web designers target more than just one browser. For that, companies like Apple and Google have a sort of ‘debt’ to Mozilla and it’s reassuring to hear that Google funds Mozilla to a great degree, still. But Mozilla has been having issues with its browser — issues that are perhaps more perceptual than real (technical). But moreover, the peril that Mozilla is having would have to be new competitors, some of whom rely on the KHTML engine (which sort of became WebKit). KHTML and WebKit also make their way into KDE in the form of new browsers like Rekonq, which are excellent (better than Konqueror for some tasks). These integrate well with a Qt-based environment, they are lightweight, and they interact better with the K Desktop Environment (or KDE SC). For KDE users who look for a Firefox alternative,
VERY once in a while we hear someone tell the public that, based on anecdotal evidence alone, people leave GNU/Linux for Apple. Well, on the phone front, if not on all fronts, Linux is actually beating Apple, which is why Apple is suing like mad. 
oday I received an early Christmas gift of sorts — a package from a fellow advocate of GNU/Linux called Kari Laine. It will provide a lot of geeky-type fun for a home project I Intend to write a review about at a later date.
e are fortunate enough to live at a time when many (if not most) phones run Linux and the overwhelming majority of Web servers do too. Those who say that GNU/Linux is “not ready for the desktop” hardly exist anymore. So for those who insist on running it on their desktop/s, there is rarely a major barrier. Videos work just fine (increasingly with HTML5 and free codecs, not Flash), a lot of applications are Web based, and some of the world’s best Web browsers are available for GNU/Linux, so how can one complain? Among developers and producers, there is no real pitfall associated with GNU/Linux (those that are brought up can easily be defended against, e.g. “fragmentation”).