I am pretty sure this is int32 problem. An signed int32 can hold a bit over 2GB (less than 2,3GB) as number of bytes. If you calculate bytes as blocks multiply 512, you will reach that border pretty soon. So just change calculation as above (omit bytes and use directly kB or even MB) and you will be able to calculate up to 2TB swap space ...