#!/usr/bin/env python3 ### Imports import os, subprocess, threading, time, gc ### Methods def fTwo(eOne) : subprocess.check_output("true") eOne.set() def fOne() : eOne = threading.Event() while True : print('.', end="", flush=True) #os.system("grep VmRSS /proc/%s/status" % os.getpid()) eOne.clear() tOne = threading.Thread(target=fTwo, args=(eOne,)) tOne.start() eOne.wait() tOne.join() #gc.collect(), gc.collect(), gc.collect() time.sleep(1) ### Execution fOne()