I have memory leak, but I can't find a way to solve it. I think the reason is for that because I use threads and don't stop/kill it in a right way.
I have following method:
import threading
def worker():
if nextJobActive() and number_of_active_threads<5:
t = threading.Thread(target=startThread, args=(my_list, my_item))
t.start()
def startThread():
#do something here, which takes ~15 Min.
I run the worker()
method in while(true) loop. I always have to start new threads in my case. But I never stop a thread. I also don't know how to do this. Is there anyway to safely stop a thread in my case?