1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/python import psutil import time delta = 50 * 60 start = time.time() while True: now = time.time() print "%s %s" % (now - start, psutil.phymem_usage().used) time.sleep(0.1) if now > start + delta: break