As an alternative to the other answer which mentions referencing compatibility pages for the computer, if there are spare RAM slots what I have done is obtain the part number of the currently installed DIMMs and then either:
- Obtain more of the same part number
- If can't find the exact same part number, look at the specification of the part number, to find a replacement with the same specification
Details of the installed DIMMs can be obtained from the booted operating system. E.g. from Windows 11 Power Shell (filtered to reduce the verbosity):
> Get-WmiObject win32_physicalmemory | Format-Table Manufacturer,DeviceLocator,PartNumber,Capacity
Manufacturer DeviceLocator PartNumber Capacity
------------ ------------- ---------- --------
Hynix CPU0-DIMM1 HMA81GR7AFR8N-VK 8589934592
Hynix CPU0-DIMM3 HMA81GR7CJR8N-VK 8589934592
Hynix CPU0-DIMM6 HMA81GR7CJR8N-VK 8589934592
Hynix CPU0-DIMM8 HMA81GR7AFR8N-VK 8589934592
The above example is from a PC which had two DIMMs fitted originally, and then fitted two more DIMMs from the same manufacturer. There are two different part numbers HMA81GR7CJR8N-VK
and HMA81GR7AFR8N-VK
since couldn't find the exact same part number for the upgrade.
Under Linux sudo dmidecode -t memory
reports the installed DIMMs.