• 0 Posts
  • 3 Comments
Joined 3年前
cake
Cake day: 2023年7月25日

help-circle
  • If I wanted to use some analogies, I would imagine RAM is the space on your desk and disk is the drawers behind you.

    Everytime the computer shutdown, the desk is totally cleared.

    When you work, you have stuff on your desk space, files that you need temporarly are also on your desk because you want to keep them and clear them on shutdown, this is what /tmp is for.

    Swap is when you desk is starting to be full, but you still need the data to work, so you have a special part in the drawer behind you that you move stuff that you don’t need right away but want to make some space on your desk. It is slightly slower to access since you need to move from your chair to get it.

    It is not uncommon for Linux to eagerly move things in swap when you are not actively using them in RAM. This allows the system to be ready if you need more space. Linux is mart enough to handle moving all of this around (RAM, swap, tmp) as efficiently as possible so that it doesn’t impact your usage of the computer. Usually tuning these things is only necessary if you have some very specific issues with your system.

    Also, since your disk is an SSD, you probably will not see a very big impact on performance. Swapping was really an issue in the past with spinning disks. SSD is not as fast as RAM, but magnitude faster and snappier than spinning disk.


  • You are correct this is the one mounted on /tmp.

    Everything under /run and /dev is normal to be on tmpfs and should not be changed.

    In Linux, a lot of internal systems and devices are considered as files even if they are not really a file in the usual sense of it. For example what is in /dev is usually not really taking up RAM space but more of a representation of the devices (internal and external) that are attached to your system. You can programatically read and write to these “files” to communicate with the devices.