When you install Ubuntu,first thing is partition one part of disk to give swap for Ubuntu system. The swap part will be used if system memory is not enough for running some programs.
The size of swap should be better between one time memory and two time memory.
How to check if it's working?
//check the disk information,it will show the size of the swap
//it will show you the information about memory and swap.