I've made a python code that download information from a new email, using a schedule method. The code is running every 20 seconds looking for the email. The problem is that the use of the system memory increases each time the information from an email is downloaded.
I wanna know if is possible to clear the system memory after data is downloaded (the information has already been stored)
The code is running in background all the time
def main(): process = psutil.Process(os.getpid()) print(process.memory_info().rss) email.read_email(service) if __name__ == '__main__': schedule.every(20).seconds.do(main) while isLocked(): schedule.run_pending()