swap is not necesserly bad per se, it can for instance happen on servers with very large uptime, that the kernel puts on swapspace parts of processes that are rarely used, to get more place to cache disk accesses.
What is suboptimal is when you're constantly swapping in and out, because this...