When your computer's RAM is full, it starts to use the swap file as a temporary storage space. It's like a holding area for all the things your computer is working on, but doesn't need immediate access to. The swap file is usually stored on your computer's hard drive, which is much slower than RAM, but it's better than nothing!
The swap file is used by your computer's operating system to swap out programs or data that aren't being used, and store them on the hard drive. This frees up RAM for more important things, like playing video games or watching cat videos. It's like a digital game of musical chairs, where your computer is constantly moving things around to make room for what's important.
Linux Add Swap File – Swap Partition: What It Is & How to Create and
But, here's the thing: swap files can be slow. Like, really slow. It's like trying to retrieve a file from a digital archive stored in a warehouse on the other side of town. Your computer has to wait for the hard drive to spin up, find the file, and load it into RAM. It's not the end of the world, but it's definitely not as fast as using RAM directly.