Check swap file
(Updated: )macOS creates a service swap file on your startup disk to transfer (or swap) unused files to and from RAM. The purpose of swap memory is to "extend" RAM by using portions of your disk to store RAM contents temporarily.
The size of the swap file changes dynamically based on your RAM needs. Occasionally, the swap file can grow significantly – sometimes several gigabytes or even the size of your RAM. This indicates that your onboard memory isn't sufficient for your tasks, so your Mac "borrows" a lot of disk space to maintain productivity.
Check swap file size
To check how much space the swap file uses, open the Menu, click Memory, and view Swap File.
Deal with large swap file
If your swap file becomes large, you can free up RAM through the Menu. (On the Intel-based Mac computers, you can also run a maintenance task.) However, if the swap file consistently grows large and your Mac frequently slows down, it might be time to upgrade your RAM or switch to a more powerful computer.
On the other hand, a small or zero-size swap file means that your RAM is handling tasks efficiently and your Mac is well-suited for your needs.
macOS manages memory swapping so smoothly that users usually don't notice it. However, when disk space is very low, the system may be unable to swap memory, causing your Mac to slow down, especially during multitasking. For optimal performance, we recommend keeping as much free disk space as the size of your RAM.