A swapfile is used by Linux when processes run out of memory. Rather than crashing, the process will be allowed to use a chunk of the disk, which is significantly slower, but prevents unintended out-of-memory crashes that can harm service availability.