How many RAM slots have you already filled on that server?

Sometimes you need to guess how many RAM slots you have already filled on a server (and how, using which model and size) without being able to open the chassis and physically inspect the situation. On Linux systems you can determine the exact modules deployed using:

$ sudo dmidecode -t memory

The output of this command is like:

Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 32 GB
    Error Information Handle: Not Provided
    Number Of Devices: 4

Handle 0x0012, DMI type 17, 28 bytes
Memory Device
    Array Handle: 0x0010
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 4096 MB
    Form Factor: DIMM
    Set: None
    Locator: A1_DIMM0
    Bank Locator: A1_BANK0
    Type: DDR3
    Type Detail: Synchronous
    Speed: 667 MHz
    Manufacturer: Corsair         
    Serial Number: 00000000  
    Asset Tag: A1_AssetTagNum0
    Part Number: CMZ8GX3M2A1600C9  
    Rank: 2

The last stanza is repeated for every memory slot provided on the motherboard. Mine have four slots and each one has a 4GB DIMM module, giving an overall total of 16GB. From the first stanza I know I can change all of them with 8GB modules to achieve the maximum supported size: 32GB. No more.