If you have unneeded swap space, you can remove it.
How to Remove Unneeded Swap Space
Become superuser.
Remove the swap space.
See AlsoWhat is Swapping in Operating Systems (OS)? - Scaler TopicsmyF5Enhance Linux Performance: Step-by-Step Guide to Increase Swap File SpaceHow to Increase Swap Space in Linux? - Scaler Topics# /usr/sbin/swap -d /path/filename
The swap file name is removed so that it is no longer available forswapping. The file itself is not deleted.
Edit the /etc/vfstab file and delete the entryfor the swap file.
Recover the disk space so that you can use it for something else.
# rm /path/filename
If the swap space is a file, remove it. Or, if the swap space is ona separate slice and you are sure you will not need it again, make a new filesystem and mount the file system.
For information on mounting a file system, see Chapter40, Mounting and Unmounting File Systems (Tasks).
Verify that the swap file is no longer available.
# swap -l
Example—Removing Unneeded Swap Space
The following examples shows how to delete the /files/swapfile swap file.
# swap -d /files/swapfile# (Remove the swap entry from the /etc/vfstab file)# rm /files/swapfile# swap -lswapfile dev swaplo blocks free/dev/dsk/c0t0d0s1 136,1 16 1638608 1600528