Did I find the right examples for you? yes no

All Samples(49)  |  Call(46)  |  Derive(0)  |  Import(3)
Return statistics about system memory usage as a namedtuple
including the following fields, expressed in bytes:

 - total:
   total physical memory available.

 - available:
   the actual amount of available memory that can be given
   instantly to processes that request more memory in bytes; this
   is calculated by summing different memory values depending on(more...)

        def virtual_memory():
    """Return statistics about system memory usage as a namedtuple
    including the following fields, expressed in bytes:

     - total:
       total physical memory available.

     - available:
       the actual amount of available memory that can be given
       instantly to processes that request more memory in bytes; this
       is calculated by summing different memory values depending on
       the platform (e.g. free + buffers + cached on Linux) and it is
       supposed to be used to monitor actual memory usage in a cross
       platform fashion.

     - percent:
       the percentage usage calculated as (total - available) / total * 100

     - used:
       memory used, calculated differently depending on the platform and
       designed for informational purposes only:
        OSX: active + inactive + wired
        BSD: active + wired + cached
        LINUX: total - free

     - free:
       memory not being used at all (zeroed) that is readily available;
       note that this doesn't reflect the actual memory available
       (use 'available' instead)

    Platform-specific fields:

     - active (UNIX):
       memory currently in use or very recently used, and so it is in RAM.

     - inactive (UNIX):
       memory that is marked as not used.

     - buffers (BSD, Linux):
       cache for things like file system metadata.

     - cached (BSD, OSX):
       cache for various things.

     - wired (OSX, BSD):
       memory that is marked to always stay in RAM. It is never moved to disk.

     - shared (BSD):
       memory that may be simultaneously accessed by multiple processes.

    The sum of 'used' and 'available' does not necessarily equal total.
    On Windows 'available' and 'free' are the same.
    """
    global _TOTAL_PHYMEM
    ret = _psplatform.virtual_memory()
    # cached for later use in Process.memory_percent()
    _TOTAL_PHYMEM = ret.total
    return ret
        


src/p/s/psutil-2.1.1/examples/top.py   psutil(Download)
        print_line(" CPU%-2s [%s%s] %5s%%" % (cpu_num, dashes, empty_dashes,
                                              perc))
    mem = psutil.virtual_memory()
    dashes, empty_dashes = get_dashes(mem.percent)
    used = mem.total - mem.available

src/p/s/psutil-HEAD/examples/top.py   psutil(Download)
        print_line(" CPU%-2s [%s%s] %5s%%" % (cpu_num, dashes, empty_dashes,
                                              perc))
    mem = psutil.virtual_memory()
    dashes, empty_dashes = get_dashes(mem.percent)
    used = mem.total - mem.available

src/p/s/psutil-2.1.1/examples/meminfo.py   psutil(Download)
def main():
    print_('MEMORY\n------')
    pprint_ntuple(psutil.virtual_memory())
    print_('\nSWAP\n----')
    pprint_ntuple(psutil.swap_memory())

src/p/s/psutil-2.1.1/examples/free.py   psutil(Download)
def main():
    virt = psutil.virtual_memory()
    swap = psutil.swap_memory()
    templ = "%-7s %10s %10s %10s %10s %10s %10s"
    print_(templ % ('', 'total', 'used', 'free', 'shared', 'buffers', 'cache'))

src/p/s/psutil-HEAD/examples/meminfo.py   psutil(Download)
def main():
    print_('MEMORY\n------')
    pprint_ntuple(psutil.virtual_memory())
    print_('\nSWAP\n----')
    pprint_ntuple(psutil.swap_memory())

src/p/s/psutil-HEAD/examples/free.py   psutil(Download)
def main():
    virt = psutil.virtual_memory()
    swap = psutil.swap_memory()
    templ = "%-7s %10s %10s %10s %10s %10s %10s"
    print_(templ % ('', 'total', 'used', 'free', 'shared', 'buffers', 'cache'))

src/p/s/psdash-0.3.0/psdash/web.py   psdash(Download)
        "load_avg": load_avg,
        "cpus": psutil.NUM_CPUS,
        "vmem": psutil.virtual_memory(),
        "swap": psutil.swap_memory(),
        "disks": disks,

src/p/s/psdash-HEAD/psdash/web.py   psdash(Download)
        "load_avg": load_avg,
        "cpus": psutil.NUM_CPUS,
        "vmem": psutil.virtual_memory(),
        "swap": psutil.swap_memory(),
        "disks": disks,

src/h/t/HTPC-Manager-HEAD/modules/stats.py   HTPC-Manager(Download)
 
        try:
            mem = psutil.virtual_memory()
            dmem = mem._asdict()
            rr = json.dumps(dmem)

src/g/l/Glances-1.7.6/glances/glances.py   Glances(Download)
try:
    # psutil.virtual_memory() only available from psutil >= 0.6
    psutil.virtual_memory()
except Exception:
    psutil_mem_vm = False
        if psutil_mem_vm:
            # RAM
            phymem = psutil.virtual_memory()
 
            # buffers and cached (Linux, BSD)

  1 | 2 | 3 | 4  Next