To change swap threshold. Set the swappiness to the percentage of free memory where you'd like swapping to start occurring.
swappiness
sysctl vm.swappiness=10 swapoff -a swapon -a