If the user no longer needs the extra swap space, you can remove it.
How to Remove Extra Swap Space
Become superuser.
Use the swap -d command to remove swap space.
See AlsoHome | WeSwapWhat Is a Swap File and How Does It Work?Swap Memory - When and How to Use It on Your Production Systems or Cloud-Provided VMs | NetdataWhat is a Swap File? Why is it Necessary & How Does it Work?# /usr/sbin/swap -d /path/filename
The swap file name is removed from the list so that it is no longer available for swapping. The file itself is not deleted.
Edit the /etc/vfstab file and delete the entry for the swap file.
See AlsoUnderstanding Swap FilesRecover the disk space so that you can use it for something else.
# rm swap-filename
If the swap space is a file, remove it. Or, if the swap space is on a separate slice and you are sure you will not need it again, make a new file system and mount the file system.
See Chapter36, Mounting and Unmounting File Systems (Tasks) for information on mounting a file system.
Example--Removing Extra Swap Space
The following examples shows how to delete the /files/swapfile swap file.
# swap -d /files/swapfile# (Remove the deleted swap entry from the /etc/vfstab file)# rm /files/swapfile# swap -lswapfile dev swaplo blocks free/dev/dsk/c0t2d0s1 32,17 8 205624 192720