i have a question about Timer object in Python: https://docs.python.org/2/library/threading.html#timer-objects
This object is basically a Thread that calls a specific function after an amount of user defined seconds. My question is: after the function call, the Thread object is automatically eliminated of the program, or this object keeps running, consuming memory?
This snippet of code shows what i'm talking about:
from threading import Timer
from random import randint
def call_function(x):
print "Timer number " + str(x) + " hit call function!"
for x in range(200000):
#memory used: 700.000 K
print "Creating timer number: " + str(x)
Timer(randint(1, 10), call_function, [x]).start()
After 200.000 threads Timer created and being called in a space of 10 seconds (after this call they were supposed to be dead, releasing space, right?), the program end it's execution with 700.000 K of memory consumption, almost 1 GB.
Thanks,