You could find it yourself applying the proper method for the OS your program is running on.
Windows: use "wmic" (eg. wmic MEMORYCHIP get BankLabel,DeviceLocator,Capacity,Tag)
Linux: use "dmidecode" (eg. dmidecode -t 17 | grep "Size.*MB" | awk '{s+=$2} END {print s / 1024}')
MacOS: use "SPHardwareDataType" (eg. /usr/sbin/system_profiler SPHardwareDataType | grep " Memory:")
All methods above untested. I just searched the Internet.