chamomile

Wool and wool accessories

Pronounced "kƦməmil"


Large sheep the size of a small sheep! Likes tea, DIY, and nerd stuff. Sysadmin, release engineer and programmer by trade.


Personal Website
bleatspeak.net/

lapisnev
@lapisnev

(Edit: at least one user is having trouble reproducing this so it may actually be Flatpak specific behavior)

I'm not sure if it freshly unpacks the runtime from scratch or simply moves the folder, but Steam for Linux will create/move the unpacked copy of Steam Runtime 3.0 (Sniper) located in ~/.local/share/Steam/ubuntu12_64/steam-runtime-sniper/var/tmp-<keysmash> every time you launch it! That's ONE POINT SEVEN GIGGLEBYTES of write endurance you're never getting back, every time you launch Steam!

This problem amplifies if you make regular backups (You DO back up your computer, right?) since every incremental of your home directory that includes Steam's data folders is now 1.7 GB larger if you launched Steam today, because the folder changed names and counts as totally new files.

A workaround is to delete the current copy of ~/.local/share/Steam/ubuntu12_64/steam-runtime-sniper/var/tmp-<keysmash>, then set up your computer to automatically mount a tmpfs at ~/.local/share/Steam/ubuntu12_64/steam-runtime-sniper/var.

Here's what my entry in /etc/fstab looks like. Note that I have a slightly different path in my entry because I'm using Steam installed from a Flatpak! This was deliberate to show an example for Flatpak, change the path to wherever you find this folder whichever way Steam is installed on your Linux computer! And you do have to change the usernames to your own username on your computer, and the two zeroes at the end are important too. "nofail" is important if the folder you're mounting this in could ever potentially be missing so that your computer will skip it and continue to boot.

tmpfs /home/username/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_64/steam-runtime-sniper/var tmpfs defaults,nofail,uid=username,gid=username 0 0

After making this change, Steam will unpack the Sniper runtime into memory instead of onto your storage. This means running Steam will require an extra 1.7 GB of RAM for a pretty crappy reason, but on the other hand, it won't write 1.7 GB to your storage every time you launch it. Also... I don't know if this is Just Me or if anyone else has noticed, but Steam is the slowest starting application on my computer by a considerable margin, and keeping these files in tmpfs makes it start noticeably faster, and could potentially make browsing the store and launching Proton faster as well (Both of these things use the Sniper runtime).

It would be really really nice if Flatpak could mount a tmpfs inside an app's private filesystem view automatically to handle this for me, since Bubblewrap supports doing it but Flatpak doesn't expose it.


You must log in to comment.

in reply to @lapisnev's post:

It's something I only noticed after I realized my backups were suddenly gigantic for no reason, which happened after switching Steam from the "native" version provided in a Gentoo overlay to the Flatpak. Which I did while trying to diagnose a different problem I was having with Steam. Good golly what a mess.

i wonder if it unpacks anything else under that directory, or if you could change up the tmpfs mount to be a couple levels higher in case they change either the target (presumably that's what ubuntu12_64 is??) or the release codename ("sniper"?), it'd still fall under your tmpfs

like go up to .var/app/com.valvesoftware.Steam/.local/share/Steam or something and be a little more future-proof

but yeah again i haven't looked to see if they unpack anything else there that might cause problems if it were ephemeral or very very large

The very next parent folder is the one where the compressed archive of the runtime lives, so you could do that, but now you have to redownload the runtime every time you reboot. Also a 1.7 GB RAM penalty to work around someone else's incompetence is already pretty severe.