occasional crashes

This looks like it could be a heat-related issue. I have a Lenovo W541 (which isn’t a T480, but still) that will throttle everything right down after it’s been running a couple of days if it’s sitting on a desk. When the machine slows down, the error messages you’ve shared appear in my system log as well. To resolve this issue, I raised the back of the notebook to allow for greater airflow. The desk was no longer storing or releasing as much heat, and this helped immensely … for about a year.

What I do now is run the machine with an external monitor and keyboard, propping the notebook itself up like a tent calendar so that all heat is radiated up and away from the case. It doesn’t look great and usually attracts a couple of questions when people see it, but these messages have completely disappeared and my machine can run for months without a reboot.

While propping your notebook up like a tent might not be the best solution, I would check that heat can escape from the case and that the bottom of the machine isn’t too hot at the time it becomes unresponsive. If you’re not running FireFox with an ad blocker, you might want to get one as modern websites will load a lot of CPU-punishing tracking code in addition to whatever content they’re offering.


SWAP

Note: Your usage suggests that you might need to add more RAM.

Your 2G /swapfile is too small, let's increase it to 4G...

Note: Incorrect use of the rm and dd commands can cause data loss. Suggest copy/paste.

In the terminal...

sudo swapoff -a           # turn off swap
sudo rm -i /swapfile      # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile  # set proper file protections
sudo mkswap /swapfile     # init /swapfile
sudo swapon /swapfile     # turn on swap
free -h                   # confirm 8G RAM and 4G swap

Edit /etc/fstab, using sudo -H gedit /etc/fstab or sudo pico /etc/fstab.

Confirm this /swapfile line in /etc/fstab... and confirm no other “swap” lines... use SPACES in this line... confirm NO TABS...

/swapfile  none  swap  sw  0  0

reboot                    # reboot and verify operation