New issue 256 by g.rodola: Rename psutil.virtmem_usage() to
psutil.swapmem_usage()
http://code.google.com/p/psutil/issues/detail?id=256
https://groups.google.com/forum/?fromgroups#!topic/psutil/IT1uaMcIVTs
virtmem_usage() should be turned into an alias raising a DeprecationWarning.
We just need to make sure the name will be consistent across all platforms
meaning we have to be 100% sure we're currently providing swap memory
information.
This might sound silly but it's a long time I don't take a look at the
memory-related functions.
In "Operating System Concepts, Silberschatz - Galvin - Gagne" the disk
memory is defined Backing Store Memory; this is the current mostly used
academical definition.
Others prefer to call it "Disk cache", this is wrong as the term is related
to the disk cache buffer and sometimes (also wrongly) to the RAMdisk.
So i suggest something like:
psutil.backmem_usage()
or
psutil.backing_usage()
or
psutil.backstore_usage()
I was guessing: wouldn't be easier to introduce a class? This could help in
obtaining a more structured portability.
mem = psutil.Memory()
In Windows:
mem.pagefile_usage
In Linux:
mem.swapfile_usage
Cross-platform:
mem.backstore_usage()
Developer may choose wheter to use the attribute bound to the OS he's
developing on or the more expensive (due to cross-platform adaptation)
method. This would sligthly help performance too.