Using TMPFS For Chromium Browser

Using tmpfs for Chromium browser can increase it’s performance. The cache will be stored in volatile memory. To use tmpfs for your chromium cache, please follow these steps

1. add this to /etc/fstab, cache-chromium /home/your_user/.cache/chromium tmpfs defaults,noatime,mode=1777 0 0
2. then rm -r /home/your_user/.cache/chromium (to delete everything you had cached)
3. and mkdir /home/your_user/.cache/chromium (to create an empty directory).

After reboot, the cache will be mounted in ram and you won’t need to modify the launcher.

Why dont use ramfs ?

Primarily both ramfs and tmpfs does the same thing with few minor differences.

Ramfs will grow dynamically.  So, you need control the process that writes the data to make sure ramfs doesn’t go above the available RAM size in the system. Let us say you have 2GB of RAM on your system and created a 1 GB ramfs and mounted as /tmp/ram. When the total size of the /tmp/ram crosses 1GB, you can still write data to it.  System will not stop you from writing data more than 1GB. However, when it goes above total RAM size of 2GB, the system may hang, as there is no place in the RAM to keep the data.

Tmpfs will not grow dynamically. It would not allow you to write more than the size you’ve specified while mounting the tmpfs. So, you don’t need to worry about controlling the process that writes the data to make sure tmpfs doesn’t go above the specified limit. It may give errors similar to “No space left on device”.

Tmpfs uses swap.

Ramfs does not use swap.

Share this content:

Post Comment