I understand swap is like an extention to RAM and is mostly used when the amount of free memory is below a certain threshold - which can be set with vm.swappiness
in /proc/sys/
. Swap can also be used for hibernation, like virtual memory on Windows.
I've come across this answer which tells a bit more about swap and how it can be used to reduce memory usage, or like disk cache:
Swap is useful because applications that aren't being used can be stored on disk until they are used. Then they can be "paged in" and run normally again. While it is not in memory, though, the OS can use that memory for something else, like disk cache.
But apart from these, what is swap used for? If I never (theoretically) run out of available memory, and don't use hibernation, would there be any downsides to having no swap? Would there be any performance improvements? Longer disk lifespan?