I inquired typeperf counters and instances, but couldn\'t find anything about the total memory. I only found
\\Memory\\Availble Bytes \\Memory\\Cache Byt
Viktar's answer (wmic memorychip get capacity) gives you the capacity of each Dimm (which will work fine, if you have only one Dimm installed but gives you one value per Dimm if there is installed more than one). To get the size of total memory use:
wmic memorychip get capacity
wmic computersystem get TotalPhysicalMemory