dmidecode reads information from the system BIOS. This may or may not be supported or reliable on different platforms whether on physical or virtual hardware. Name brand server hardware is likely to report supported memory from the vendor, while an inexpensive workstation is less likely to report any meaningful data in the BIOS.
If the system BIOS does not report the DMI information you will need a tool that can do a deep dive onto your specific hardware by interrogating the memory controller hub. Since you are looking at virtual hardware this will not exist since the physical MCH would be obscured by the virtualization layer.
That leaves benchmarking. Many utilities exist that will measure raw memory performance. These will have highly variable measurements based on the virtualization platform, CPU, other loads on the host, etc.. You will be able to get a baseline number and be able to compare it to the same tool run on the physical machine to judge your virtualization overhead. The CPU, cache, virtualization, and other factors likely mean you will not be able to place any bets on what type of physical memory is installed.