• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

VMware

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dears,

I have VMware for Ubuntu on my PC which is Windows 10.
I run a python script on the VMware, I specified 16GB for VMware.

The script has to calculate the maximum RAM memory percentage.

psutil.virtual_memory().percent

I know this psutil.virtual_memory() will calculate

((𝑡𝑜𝑡𝑎𝑙 𝑚𝑒𝑚𝑜𝑟𝑦 −𝑎𝑣𝑎𝑖𝑙𝑎𝑏𝑙𝑒 𝑚𝑒𝑚𝑜𝑟𝑦 )/(𝑡𝑜𝑡𝑎𝑙 𝑚𝑒𝑚𝑜𝑟𝑦 ))  ∗100

My question is that, does the total memory means 16GB ? or the whole PC total memory which is 32GB.
Please I couldn't find enough answer in the web.
 
Saloon Keeper
Posts: 28320
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Aminah!

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.
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic