Within a VM, the only memory that counts is the memory that was defined for the Virtual Machine. You should not expect to be able to tell how much RAM (physical or virtual) is available on the host (real) machine that contains the VM unless you are using a special package that escapes data flow from the VM to the host. The standard python (and Java) memory services don't do that. They can only report what's available in the VM.
Note that a VM can define itself to have more memory than the physical machine that contains it does. Although if you're not careful you can end up with serious VM page thrashing issues.
I'm going to be a "small government" candidate. I'll be the government. Just me. No one else.