ubuntu how to clear swap memory in linux code example Example: clear swap memory linux sudo swapoff -a; sudo swapon -a