0

I trying to find out a way to free the memory in my python script before start.

How can I delete all created variables in python to make sure the script have all memory available?

Thanks in advance!

1 Answer 1

1

gc.collect() will release all unreferenced memory. (see https://docs.python.org/2.7/library/gc.html)

But to deliberately delete variables use del. Keep in mind you'll need to do this for all variables.

myvar1 = 1
myvar2 = True
del myvar1
del myvar2
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.