parameters: (self, memtype="rss")
return_statement: return (value / float(total_phymem)) * 100
docstring: Compare process memory to total physical system memory and
          calculate process memory utilization as a percentage.
          *memtype* argument is a string that dictates what type of
          process memory you want to compare against (defaults to "rss").
          The list of available strings can be obtained like this:
  
          >>> psutil.Process().memory_info()._fields
          ('rss', 'vms', 'shared', 'text', 'lib', 'data', 'dirty', 'uss', 'pss')
docstring_summary: Compare process memory to total physical system memory and
          calculate process memory utilization as a percentage.
          *memtype* argument is a string that dictates what type of
          process memory you want to compare against (defaults to "rss").
          The list of available strings can be obtained like this:
docstring_tokens: Compare process memory to total physical system memory and calculate process memory utilization as a percentage . * memtype * argument is a string that dictates what type of process memory you want to compare against ( defaults to rss ) . The list of available strings can be obtained like this :
function: def memory_percent(self, memtype="rss"):
          """Compare process memory to total physical system memory and
          calculate process memory utilization as a percentage.
          *memtype* argument is a string that dictates what type of
          process memory you want to compare against (defaults to "rss").
          The list of available strings can be obtained like this:
  
          >>> psutil.Process().memory_info()._fields
          ('rss', 'vms', 'shared', 'text', 'lib', 'data', 'dirty', 'uss', 'pss')
          """
          valid_types = list(_psplatform.pfullmem._fields)
          if memtype not in valid_types:
              raise ValueError("invalid memtype %r; valid types are %r" % (
                  memtype, tuple(valid_types)))
          fun = self.memory_info if memtype in _psplatform.pmem._fields else \
              self.memory_full_info
          metrics = fun()
          value = getattr(metrics, memtype)
  
          # use cached value if available
          total_phymem = _TOTAL_PHYMEM or virtual_memory().total
          if not total_phymem > 0:
              # we should never get here
              raise ValueError(
                  "can't calculate process memory percent because "
                  "total physical system memory is not positive (%r)"
                  % total_phymem)
          return (value / float(total_phymem)) * 100
function_tokens: def memory_percent ( self , memtype = "rss" ) : valid_types = list ( _psplatform . pfullmem . _fields ) if memtype not in valid_types : raise ValueError ( "invalid memtype %r; valid types are %r" % ( memtype , tuple ( valid_types ) ) ) fun = self . memory_info if memtype in _psplatform . pmem . _fields else self . memory_full_info metrics = fun ( ) value = getattr ( metrics , memtype ) # use cached value if available total_phymem = _TOTAL_PHYMEM or virtual_memory ( ) . total if not total_phymem > 0 : # we should never get here raise ValueError ( "can't calculate process memory percent because " "total physical system memory is not positive (%r)" % total_phymem ) return ( value / float ( total_phymem ) ) * 100