Option 1: Using memtester
sudo apt install memtester
sudo memtester 16G 1
memtester version 4.6.0 (64-bit)
Copyright (C) 2001-2020 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).
pagesize is 4096
pagesizemask is 0xfffffffffffff000
want 16384MB (17179869184 bytes)
got 16384MB (17179869184 bytes), trying mlock ...locked.
Loop 1/1:
Stuck Address : ok
Random Value : ok
Compare XOR : ok
Compare SUB : ok
Compare MUL : ok
Compare DIV : ok
Compare OR : ok
Compare AND : ok
Sequential Increment: ok
Solid Bits : ok
Block Sequential : ok
Checkerboard : testing 46
Option 2: Using stress-ng
sudo apt install stress-ng
stress-ng --vm 1 --vm-bytes 50% --vm-method all --verify -t 10m
Option 2: Using memtest86+
sudo apt install memtest86+
This adds a menu in GRUB bootloader. Use this boot option to conuct test.
Also look at this reference: https://www.baeldung.com/linux/ram-testing