Following are some methods to check the memory usage in Ubuntu. More details about these tools can be found from the man pages.
free
free command displays amount of total, free and used RAM in the system, as well as shoing information on shared memory, buffers, cached memory and swap space used by the Linux kernel.
vmstat
vmstat reports report . . . → Read More: How To Check The Memory Usage Stats On Ubuntu Server Via Command Line