How do I know which RAM I'm using?

Solution 1:

You can get all you want from this command:

sudo dmidecode --type memory

1st part of the information you get:

SMBIOS 2.7 present.

Handle 0x001B, DMI type 16, 23 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 16 GB
    Error Information Handle: No Error
    Number Of Devices: 2

Handle 0x001C, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x001B
    Error Information Handle: 0x001E
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 4096 MB
    Form Factor: SODIMM
    Set: None
    Locator: ChannelA-DIMM0
    Bank Locator: BANK 0
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1333 MHz
    Manufacturer: ELPIDA
    Serial Number: 5A0C95A6
    Asset Tag: 0123456789
    Part Number: EBJ41UF8BAS0-DJ-F 
    Rank: Unknown
    Configured Clock Speed: 1333 MHz

Solution 2:

This answer isn't particularly Ubuntu, but it's often the most convenient one.

Find out the model of your computer (or if it's a custom assembly job, of your motherboard). Enter the model in the memory search tool on the website of a major RAM vendor (for example Crucial or Kingston). The site will tell you which of their product are guaranteed to be compatible with your system. Even if you don't wish to buy from that vendor, you can note the characteristics and look them up on your favorite vendor.