Run memtest in terminal [duplicate]
memtest is usually run separately to a Linux kernel (selected as a boot option instead of Ubuntu), although you could download a memtest package and run it from within Ubuntu with the following commands.
sudo apt-get install memtester
sudo memtester 1024 5
Running it separately to Ubuntu gives it greater access to the machine's memory, so is the preferred method.
See How to check for errors in RAM via linux? for more details.