How do I close a python thread in order to make sure that it cleared from memory? Currently looking at using weakref but I do not know how to implement it for a class like what I have listed below. Threads are being closed (joined) but the memory seems to continuously increase. So I don't think they are being garbage collected.
threadlist = []
for r in something:
t = MyThread()
threadlist.append(t)
for thread in threadlist:
thread.start()
for thread in threadlist:
thread.join()
class MyThread(threading.Thread):
def __init__(self):
super(MyThread, self).__init__()
def run(self):
# do something