RT Cunningham

Improving Performance on Linux Mint

Written on Mar 4, 2026

Tagged: computers, linux, programming

Linux Mint Cinnamon

Linux Mint, regardless of the edition, performs well right out of the box when used with a solid-state drive. Most new computers come with one type of solid-state drive or another inside of them. As good as an solid-state drive may be, nothing beats memory for temporary storage.

I have 16 gigabytes of memory in my mini PC. The laptop I'll be using later this month also has 16 gigabytes of memory in it. When I was tracking memory usage, I never saw Linux Mint use more than six gigabytes even when I was browsing multiple websites. I never saw more than two gigabytes of swap file usage.

I will never use even half of the memory available to me. It makes a lot of sense, at least to me, to use some of it for temporary storage and swap space. The Cinnamon Edition of Linux Mint flies when not writing to the file system.

Moving Directories to Memory

Up to fifty percent of memory can be used by tmpfs (temporary file system), and it grows or shrinks based on the files it contains. Two directories that are frequently written to are not stored in memory. They are "/tmp" and "/home/username/.cache", with "username" being your actual user name. The first one can be directly moved to tmpfs, while the second one can be linked to tmpfs.

Move the "/tmp" Directory

Clear the "/tmp" directory before moving it to tmpfs. At the terminal:

sudo cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/
sudo systemctl enable tmp.mount

Link the "/home/username/.cache" Directory

Clear the "/home/username/.cache" directory before linking it to tmpfs. At the terminal:

mkdir -p ~/.local/share/user-tmpfiles.d

Enter these two lines at once, exactly as written (replacing "username", of course):

echo "D /run/user/1000/cache 0700 username username 1w
L+ /home/username/.cache - - - - /run/user/1000/cache" > ~/.local/share/user-tmpfiles.d/cachetmp.conf

These two lines will enable the clearing of that directory once a week if you leave your PC on for a week (using suspend to memory, of course):

systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer
systemctl --user start  systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer

Use Memory for Swapping

By default, Linux Mint creates a two-gigabyte swap file. This is something that can be written to quite a lot. I prefer installing "zram", which creates a swap partition. The swap file will not be used until the zram partition is full. At the terminal, in the user home directory:

sudo apt install git
git clone https://github.com/foundObjects/zram-swap.git
cd zram-swap && sudo ./install.sh

It will automatically use up to half the memory, but doesn't subtract from total memory until it's used. You can reduce it in the "/etc/default/zram-swap" file. I set mine to four gigabytes near the end of the file.

Does This Really Improve Performance?

It does, but it may not be perceptible, especially with a powerful processor and the latest type of solid-state drive. One of the slowest parts of computing is writing to disk, any kind of disk. Caching is known to improve performance, and caching from files stored in memory instead of disk is going to improve it more.

Image from linuxmint.com