# HG changeset patch # User Jeff Hammel # Date 1485913085 28800 # Node ID 7c2dbd45c34674f10af64f6b3521838dc0505d39 # Parent 737b9eda7f77ba4a7b24cc7311c0bd6d50c866a1 rss example program diff -r 737b9eda7f77 -r 7c2dbd45c346 python/example/rss.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/example/rss.py Tue Jan 31 17:38:05 2017 -0800 @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +import psutil + +PSNAME = 'python' + +for process in psutil.process_iter(): + try: + memory = process.memory_info() + if process.name() == PSNAME: + print int(memory.rss) + except Exception: + pass