This guide explains how to set up a RAM directory in which KDE to store its cache, allowing it to load and run faster. It’s a nice improvement especially if you have old IDE/SATA drives with low read/write rates but won’t pretty much make any difference if you have SSD drives.

Before we start, let’s choose a size for the KDE cache RAM folder. If you have 1GB of RAM, use just half of it, 512M and for 2GB of RAM or more, use 1024M. I haven’t managed to make KDE use more than 250M but I guess it depends on the complexity of the applications everyone is running.

First of all, add the following line to /etc/fstab by editing it with nano. Open a terminal and:

sudo mkdir /kde-ram
sudo nano /etc/fstab
tmpfs /kde-ram tmpfs noatime,nosuid,nodev,size=1024M 0 0

Now, create the following file and add these lines to it. Replace USERNAME with the user name you use to login:

nano ~/.kde/env/relo.sh
export KDETMP=/kde-ram
export KDEVARTMP=/kde-ram
ln -s /kde-ram/kde-USERNAME

Find out your computer hostname if you don’t already know. Run this command:

hostname
linuxlove

The last step is a bit tricky and you’ll have to memorize it. Log out from the current session and during the login screen press Ctrl + Alt + F1. This will open a non graphical console where you need to login and run these commands:

rm -rf .kde/tmp-YOURHOSTNAME

My hostname command returned linuxlove so I’ve typed this:

rm -rf .kde/tmp-linuxlove

Replace your accordingly, then run

sudo reboot

To reverse the changes, run

sudo nano /etc/fstab

and delete the tmpfs line, then log out from the current session and during the login screen press Ctrl + Alt + F1. This will open a non graphical console where you need to login and run this command:

rm -rf .kde/tmp-YOURHOSTNAME

Now reboot. That’s it.

And

HowTo: Make KDE run faster by setting-up RAM cache
Tagged on: