Swap memory or swap space is used when the amount of physical memory (RAM) is full. If the physical memory is not sufficient to handle tasks, then the operating system will start to swap out the least used portions of the memory into the swap space. In this way, it can free up the physical memory for more important or frequently used data. This allows for more efficient use of memory resources. However, the downside is that accessing the swap memory is slower compared to the physical memory. This can lead to decreased system performance if the system relies too much on the swap memory.