If your concerned about the content of the swap you can always turn it off as specified in the usual way with
sudo swapoff -a and then fill the swap device with zeros or random data using dd.
First use the content of fstab to find your swapfile or device (
Having located it and double and triple checked it's location at say sda5 or
/swapfile (swap partitions were replaced by default with a swapfile in 17.04 and beyond.).
In the case of a swap partition or drive:(prefaced with /dev) issue the "disk destroyer" command (not to be used lightly)
sudo dd if=/dev/zero of=swap replacing the word swap with the swap device or file you located in
to blast it full of zeros or
sudo dd if=/dev/random of=swap again replacing the word swap with the swap device or file you located in
to blast it full of random data.
In the case of a swapfile (prefaced with only a path): you can simply delete the file with
The next time you turn swap on with
The system will happily use it again. If you have plenty of RAM you may not need swap at all. Issue the command
when the system is under heavy load and see how much is in use to make this determination.
If you determine that you permanently don't need swap (for hibernation or anything else) you can simply comment out that line in fstab as suggested here