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.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Catch Ernie! Catch the egg! And catch this tiny ad too:
a bit of art, as a gift, the permaculture playing cards