Can i clear system memory after every scheduled (using schedule.every() method) iteration?

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

Python v3.7.8

def main():
   process = psutil.Process(os.getpid())


if __name__ == '__main__':
   while isLocked():

Read more here:

Content Attribution

This content was originally published by Edier Yasser Perea at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: